Which of the following statements declares an object to represent the pseudo-random number generator in a procedure? a. Dim randGen As New RandomNumber b. Dim randGen As New Generator c. Dim randGen As New Random d. Dim randGen As New RandomObject
Q: Which of the below is a valid and correct mutator method for 'foodName' (String) attribute of 'Food'…
A: Among the valid and correct mutator method for 'FoodName' string attribute of 'Food' class is as…
Q: You declare a named constant with which keyword? 1. Constant 2. Const 3. NamedConstant 4. Dim
A: Given: You declare a named constant with which keyword?1. Constant2. Const3. NamedConstant4. Dim
Q: import random import math Which of the following will assign a random integer from 30 to 90,…
A: In Python, Both random.randint(start, end) and random.randrange(start, end) is used to get a random…
Q: Which of the following statements are true? You may select more than one answer. A penalty applies…
A: Debugging is to run the code, step by step on a debugging tool, in order to find the exact mistake…
Q: A Sub procedure named GetEndInv is passed four Integer variables from its calling statement. The…
A: Given statement: The given procedure header (a) states that all the variables except final are…
Q: Which of the following methods returns a value?
A: Here we take all methods and explain how it's working: ================================== 1.take as…
Q: Which of the following is a valid header for a procedure that receives an integer followed by a…
A: Valid header for a procedure A procedure is a group of statements that perform a specific task. A…
Q: Which of the following methods correctly withdraws an amount from a bank account? Method…
A: The correct option is
Q: Which of the following are illegal variable names? (select all illegal names) O dayOfWeek O 3dGraph…
A: The question is on finding the illegal variable names in C++.
Q: Which of the following statements invokes the GetArea Sub procedure, passing it two variables by…
A: Justification: The first statement, “GetArea(dblLength, dblWidth) As Double” is wrong. It is…
Q: Which one of the following lists contains only legal MATLAB variable ?names MyScore1,…
A: 1. The best answer is the first one in all other options the variable name starting either by number…
Q: Which of the following expressions will generate a random integer from 25 through 50, 2. inclusive?…
A: Note: According to the BNED Guidelines, we can answer only one question at a time. Please re-submit…
Q: Which of the following statements declares a procedure-level variable that remains in the computer’s…
A: The answer is given below,
Q: Below is the code for a procedure that will accept a Customer ID as an input parameter and display…
A: Q 1 % type attribute is used to create an attribute with the same size and data type as defined in a…
Q: Create an application that allows you to enter n customer names and phone numbers.
A: Solution: Customer.java class Customer{ private String name; private long phoneNo;…
Q: Which of the following does NOT generate a psuedo-random number between 1-10? a.…
A: random module has various methods to generate random numbers and randrange, randint are the most…
Q: Which of the following statements generates a random integer from 1 to 25 (including 25)? a. intNum…
A: Statement generating a random integer The statement to generate random integer is…
Q: Which of the following is a valid header for a procedure that receives a copy of the value stored in…
A: Justification: Based on the procedure header syntax, the statement "Private Sub DisplayName(ByCopy…
Q: Which of the following is valid datatype to declare a variable with value 45.6? a. int b. break C.…
A: Solution : The correct answer is d. float
Q: In which of the following variable declarations does the declared variable have a value of null? COW…
A: Coded using Java.
Q: Which of the following is a valid header for a procedure that receives an integer followed by a…
A: Procedure in Visual Basic A procedure is defined as a set of statements that includes in a program…
Q: The CALL command is not permitted to contain procedure arguments.True or False.
A: A command is a directive to a computer program to perform a specific task.
Q: The current value for the HOME variable is displayed by which of the following commands?(Choose all…
A: Answer: The current value for the HOME variable is displayed by the following commands, echo ~echo…
Q: if y is random value from 0.2 to 0.3 then the correct command is? float y =random(0.3),
A: Correct Answer A)
Q: Which of the following is a valid reference count for an object that is being referenced? 2.5 3.0 O…
A: Reference counting: We can't calculate the life of an object, so we need a life management…
Q: Which of the following is the name of the Inventory class’s default constructor? a. Inventory b.…
A: Syntax for creating the constructor is : Public Sub New([parameterList]) Initialize the private…
Q: Which of the following statements declares a procedure-level variable that is removed from the…
A: Explanation: Procedure level variable is a variable declaration statement, which maintains the…
Q: Which of the following will not return a value? a. Null b. Void c. Empty d. Free In C. hangat aauta
A: NOTE :- As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Which of the following is false? a. When you pass a variable by reference, the receiving procedure…
A: The false option is OPTION (B)
Q: Which of theae datatype value is returned by equals() method of string class?? A. char B. int…
A: HELLO THERE,I AM ADDING ANSWER WITH EXPLANATION BELOWPLEASE GO THROUGH IT THANK YOU
Q: When entered in the appropriate event procedure, which of the following statements cancels the key…
A: If a key is pressed within a control, then the “KeyPress” event will occur. The “KeyPress” event…
Q: Which of the following statements adds together the contents of the intScore1 and intScore2…
A: Answer: The “intScore1” and “intScore2” are the two variables add the contents and then multiplied…
Q: Which of the following statements invokes the GetGross function and assigns its return value to the…
A: Invoking function: A function procedure returns a value e of the tasks performed. Syntax for…
Q: Which expression yields a random number between 11 and 26, inclusive? O (rand () % 16) + 11 O rand…
A: The correct answer is (rand() % 15) + 11
Q: Which of the following statement is TRUE? A. O A char datatype can only hold numbers. A char…
A: Given: To choose correct statement.
Q: How about this 3) Prompt the user to search for the student id by the student's name.
A: #include <stdio.h>#include <string.h>#include <stdlib.h>// create struct for…
Q: Which of the following is false? a. A function returns only one value to the statement that invoked…
A: Sub procedure can contain more than one parameter in its parameter list. Variables in the parameter…
Q: What are the items that appear within parentheses in a procedure header called? a. arguments b.…
A: 1. Items that appear inside the parentheses of a calling statement are called arguments. 2. Items…
Q: Which of the following statements is TRUE about passing parameters by reference and by value? A.…
A: FALSE Passing by reference just requires passing of an address. It is more time and space efficient…
Q: The DateTime.TryParse method will successfully convert the string “8/22/1990” to a DateTime object.…
A: DateTime.TryParse(String, DateTime) method is used to parse the string representation of a date and…
Q: Which of the following variable names will result in an error? int first code SellingPrice
A: There are some standards one must follow while declaring a variable name
Q: What value is returned by the IndexOf and LastIndexOf methods if the substring being searched for is…
A: IndexOf(): The indexOf() method returns the index value of the specified character for the java…
Q: Which of the following statements declares a class-level variable? a. Class intNum As Integer b.…
A: ANS: - Option(b) Private intNum as Integer is correct.
Q: Which of the following is false? a. A Sub procedure can accept items passed either by value or by…
A: Procedure or method: A procedure is a set of instructions or code statements enclosed in an open…
Q: Which of the following methods will not return a set of elements that contains a div with class…
A: Q: JS Element which will not return div with 'special' class.
Q: Which property of the KeyPress procedure’s e parameter is used to cancel the key pressed by the…
A: Property to cancel the key pressed by the user: If a key is pressed within a control (i.e. the…
Q: 2 - Which function can be used to show the usage information for a method? a. enumerate() b. dir()…
A: Given problem contains four functions, enumerate() dir() help() main()
Which of the following statements declares an object to represent the pseudo-random
number generator in a procedure?
a. Dim randGen As New RandomNumber
b. Dim randGen As New Generator
c. Dim randGen As New Random
d. Dim randGen As New RandomObject
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- A Java Practical Assignments.pdf - Adobe Acrobat Pro DC (32-bit) File Edit View E-Sign Window Help Home Tools Java Practical Assig. x Sign In 1 /1 139% Java Practical Assignments 1. Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays an appropriate message. 2. Create a program that allows a user to input customer records (ID number, first name, last name, and balance owed) and save each record to a file. 3. Write an application for Limpopo's Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that corresponds to one of the options, and display the option and its price as R250, R220, R150, or R50, accordingly. Display an error message if the…True or False? Arrays cannot be passed as parameters, but must be used only in the main method.// Question 4: // Declare an integer variable named "variables with an initial value of 10. // Write a method named "SetToOne" that takes one out parameter. // The method should set the out parameter to 1. // Call the method SetToOne passing variables in the btngs click method. // Display the variable variables in the lblQ4. private void btn04_Click(object sender, EventArgs e) {
- // Question 4: // Declare an integer variable named "variables with an initial value of 10. // Write a method named "SetToOne" that takes one out parameter. // The method should set the out parameter to 1. // Call the method SetToOne passing variables in the btnQ4 click method. // Display the variable variables in the lblQ4. private void btn04_Click(object sender, EventArgs e) {Which of the following is true for a method have int return type? a)The method can have only one return statement within one-way if b)The method having only return statement within if must be two-way c)The method need not have a return statement d)The return statement should not be within ifA method CAN be invoked using a variable that is initialized to null. True O False
- In the code, if "play" is a procedure, what does "song" represent in the line: play(song)? Explain why you think your answer is correct OR what confuses you about this question.A) It is the name of the procedure for documentation purposes.B) It is an input value where the user requests the song to be played.C) It is a value being passed to the procedure via an arguement that will be used as a parameter in the procedure.D) It is an expression that must be evaluated to be used in the procedure.Which of the following statements generates a random integer from 1 to 25 (including 25)? a. intNum = randGen.Next(1, 25) b. intNum = randGen.Next(1, 26) c. intNum = randGen(1, 25) d. intNum = randGen.NextNumber(1, 26)// Question 4: // 20 Points // Declare an integer variable named "variableQ4" with an initial value of 10. // Write a method named "SetToOne" that takes one out parameter. // The method should set the out parameter to 1. // Call the method SetToOne passing variableQ4 in the btnQ4 click method. // Display the variable variableQ4 in the lblQ4. 1 reference private void btnQ4_Click(object sender, EventArgs e) { }
- num1 – a positive integer representing the first digit in the combination num2 – a positive integer representing the second digit in the combination num3 – a positive integer representing the third digit in the combination num4 – a positive integer representing the fourth digit in the combination num5 – a positive integer representing the fifth digit in the combination Description: You own a combination lock that only opens when presented with the correct sequence of odd and even numbers that are less than 10. Write a function that takes in 5 integers. Check whether they are in this order: odd, even, odd, even, odd. If they are in the correct order and all below 10, then print the string “You opened the lock.” Otherwise, print “You are locked out.” Enclose function in a while loop and ask user for parameters using input(). Test Cases: >>>comboLock(9, 2, 5, 4, 1) You opened the lock. >>>comboLock(1, 8, 3, 6, 8) “You are locked out.” >>>comboLock(2, 2, 5, 6, 4)…In this exercise, you modify the Grade Calculator application from this chapter’s Apply lesson. Use Windows to make a copy of the Grade Solution folder. Rename the copy Grade Solution-Intermediate. Open the Grade Solution.sln file contained in the Grade Solution-Intermediate folder. Open the CourseGrade.vb file. The DetermineGrade method should accept an integer that represents the total number of points that can be earned in the course. (Currently, the total number of points is 200: 100 points per test.) For an A grade, the student must earn at least 90% of the total points. For a B, C, and D grade, the student must earn at least 80%, 70%, and 60%, respectively. If the student earns less than 60% of the total points, the grade is F. Make the appropriate modifications to the DetermineGrade method and then save the solution. Unlock the controls on the form. Add a label control and a text box to the form. Change the label control’s Text property to “&Maximum points:” (without the quotation marks). Change the text box’s name to txtMax. Lock the controls and then reset the tab order. Open the form’s Code Editor window. The txtMax control should accept only numbers and the Backspace key. Code the appropriate procedure. The grade should be cleared when the user makes a change to the contents of the txtMax control. Code the appropriate procedure. Modify the frmMain_Load procedure so that each list box displays numbers from 0 through 200. Locate the btnDisplay_Click procedure. If the txtMax control does not contain a value, display an appropriate message. The maximum number allowed in the txtMax control should be 400; if the control contains a number that is more than 400, display an appropriate message. The statement that calculates the grade should pass the maximum number of points to the studentGrade object’s DetermineGrade method. Make the necessary modifications to the procedure. Save the solution and then start and test the application.True or False: Between method calls, the value of a local variable is preserved.