Which of the following methods returns a value?
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: Question There are two classes first and second, whenever the mouse enters first class should be…
A: HTML, or HyperText Markup Language, is the basic markup language for documents that are intended to…
Q: Create a program named SalesLetter whose Main() method uses several WriteLine() calls to display a…
A: using System; class MainClass { public static void Main(string[] args) { Console.WriteLine("FROM:");…
Q: If the strAddress variable contains the string “41 Main Street”, what will the…
A: String.IndexOf Method: IndexOf method is used to find the zero based index of the first…
Q: Create an application named Test whose main() method holds two integer variables. Assign values to…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
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: If the strMsg variable contains the string "Happy New Year", what will the IndexOf method return in…
A: IndexOf(): The method "IndexOf()" returns the zero-based index of the specified string’s first…
Q: Which of the following is a correct method call to the method defined below? Select the best option…
A: Ans : The following that is the correct method call to the method that is given is : b)…
Q: If the txtTax.Text property contains 6.89, what number will the Decimal. TryParse(txtTax.Text,…
A: The value stored in the variable decTax would be True.
Q: For each of the points labeled by comments, identify each of the assertions in the table below as…
A: Answer: Point A: SOMETIMES PointB: NEVER Point C: SOMETIMES
Q: Which of the following code is used to check the web worker object is exists or o the web worker…
A: We need to find which line of code is used to check if the Web Worker object exists or not. If not…
Q: 14 - final question Assuming you have placed a button called button1 on your Windows Form and you…
A: Assuming you have placed a button called button1 on your Windows Form and you have created a button…
Q: In which of the following variable declarations does the declared variable have a value of null? COW…
A: Coded using Java.
Q: Create an application named ConvertMilesToKilometers whose Main() method prompts a user for a number…
A: C# CODE TO COPY:- using System.IO;using System; class ConvertMilesToKilometers{static void…
Q: Which keyword can you use to immediately give control back to a method's caller? O a. next O b.…
A: The "return" statement: The "return" statement is used to stop the flow of the execution in the…
Q: Which of the following is a valid declaration of an object of class Box? Select one: O a. new Box…
A: In Java, Correct object declaration is class_name object_name = new class_name ();
Q: Please help me with the following:
A: - We need to highlight the correct return value from the function to main with the switch case. -…
Q: Which of the following methods is an internal method that the user doesn't need to access?…
A: The solution for the above given solution is given below:
Q: Create a class named Eggs. It’s main () method holds an integer variable named numberOfEggs to which…
A: Algorithm: 1. Start. 2. Read number of eggs as numberOfEggs. 3. Call method to calculate and print…
Q: // Question 4: // 20 Points // Declare an integer variable named "variableQ4" with an initial value…
A: Answer - Given method - private void btnQ4_Click(object sender, EventArgs e){ } Here from the name…
Q: Complete the following code in order to convert the contents of TxtBox.Text to an integer, storing…
A: To Convert String to integer we need to use Convert.ToInt32(TxtBox.Text) statement as shown below:
Q: Which of the following code is used to check the web worker object is exists or o the web worker…
A: The code that is used to create the web worker object if does not exists: - if…
Q: Create a method that will display the transcript of the student, which must include the student…
A: Create a method that will display the transcript of the student, which must include the…
Q: Create an application named Numbers whose main() method holds two integer variables. Assign values…
A: PROGRAM INTRODUCTION: Use the required namespaces. Start the definition of the class to store all…
Q: Create an application named ConvertMilesToKilometers whose Main() method prompts a user for a number…
A: Step 1:- Program Approach:- Declare the user-defined function whose name is double…
Q: Write an application for Lambert’s Vacation Rentals. Use separate ButtonGroups to allow a client to…
A: PROGRAM APPROACH: Here, we will use awt and swing packages to create the required applications. The…
Q: Which of the following is false according to the code below? When the user submits the form…
A: The h:selectOneMenu tag represents a component that contains a list of items from which a user can…
Q: Q3. Write a PHP class named "Differ" which accepts two arguments as date and via method named…
A: $d1 = new DateTime("2018-01-10 00:00:00");$d2 = new DateTime("2019-05-18 01:23:45");$interval =…
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: Which is the correct way to create a method header using correct syntax? public void myCircle()…
A: The general syntax of a method is: accessModifier returnType functionName()
Q: Which of the following method correctly avoids "Shadowing"? Select ALL that apply. public void…
A: Here is the explanation about overshadowing:
Q: If the strAddress variable contains the string “34 Ridge Court”, what will…
A: Value returned by method The IndexOf method is used to return the position of first occurrence of a…
Q: Create an application named SalesTransactiobDemo that declares several SalesTransaction objects and…
A: The complete code is given below with the output.
Q: Which statement creates a text field, scoreField, that accepts only integer numbers as input? O…
A:
Q: According to the following, which is a valid way to call the displayIt method? private int…
A: Answer: Explanation: A display method is not a physical field in a table but rather a method of…
Q: The following createPassword methods takes first name and last name as its parameters and generates…
A: GIVEN CODE: //Defining class class Main { //Defining createPassword() public static String…
Q: Create an application named Percentages whose main() method holds two double variables. Assign…
A: public class PercentComputation { //function to compute percentagepublic static void…
Q: Which of the following statements is true? a. Methods find and lookingAt (from class M b. Class…
A: Matcher is the class used to match a text against a pattern. This class provides various methods for…
Q: Which of the following is an example of encapsulation? a. variable O b. class O c. constant O d.…
A: Question from basic concept of Object Oriented programming(OOP). We have to tell, which one is the…
Q: // Question 4: // Declare an integer variable named "variableQ4" with an initial value of 10. //…
A: Below I have provided C# Programming. Also, I have attached the screenshot of the code and output of…
Q: Which method call includes arguments that are value-returning method calls? a. addNumbers (num1,…
A: Function or Methods A function is a block of code used to perform specific task in a program.…
Q: Create an application for a library and name it FineForOverdueBooks. The Main() method asks the user…
A: Start Input books Input days If days<=7, calculated by multiplying 10 Else, calculate for 7 days…
Q: Which code line could possibly call a method with the following header: public static int myMethod (…
A: In The Above Code Method myMethod(int x,double height) Having two Parameter x and height and It Has…
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: a field with the id numberGuests into which the user is instructed to enter a number between 20 and…
A: Given : A web form includes a field with the id numberGuests into which the user is instructed to…
Q: Which of the following method reads input from the user and return String value? Select one: O a.…
A: d. nextLine()
Q: Which of the following is an invalid name for an object? a. picMy.Dog b. btnCalcSalesTax c. lbl2017…
A: Invalid name for an object The object name is a Unicode string that contains both user-mode and…
Q: Q3. Please answer the following questions a. Can prompt method take two input values from user? If…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: To display 'Question 2' in the command window, the correct command is .A disp(Question 2) .B disply…
A: disp() is a MATLAB function that is used to display the value of any variable. However the function…
Method changeName(String lName, String fName)
lastName = lName firstName = fName Display "The name has been changed to " + firstName + " " + lastName End Method |
||
Method displayInfo()
Display "Account #: " + acctNumber Display "Account type: " + acctType Display "Owner name: " + lastName + ", " + firstName Display "Current balance: " + acctBal End Method |
||
Method withdraw(Numeric amt)
acctBal = acctBal - amt Display "The new balance is: $" + acctBal End Method |
||
Method inquire()
Return acc |
Here we take all methods and explain how it's working:
==================================
1.take as fname and lname and display the changed name.
That is not return any value.
2.second methods show all account information.
So,that is not return any value.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- The Item class contains a Public method named GetDiscount. The method is a function. An application instantiates an Item object and assigns it to a variable named cellPhone. Which of the following can be used by the application to invoke the GetDiscount method? a. dblDiscount = Item.GetDiscount b. dblDiscount = cellPhone.GetDiscount c. dblDiscount = GetDiscount.cellPhone d. cellPhone.GetDiscountWhich of the following methods correctly withdraws an amount from a bank account? Method withdraw(Numeric amt) acctBal = acctBal - amt Display "The new balance is: $" + acctBalEnd Method Method withdraw(String amt) acctBal = acctBal - amt Display "The new balance is: $" + acctBalEnd Method Method withdraw(Numeric amount) acctBal = acctBal - amt Display "The new balance is: $" + acctBalEnd Method Method withdraw(String amount) acctBal = acctBal - amt Display "The new balance is: $" + acctBalEnd MethodIn 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.
- // 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) {// 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: // 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) { }
- Methods with an empty parameter list and do not return a value: [Questions 1-8 required] You invoke a method by its name followed by a pair of brackets and the usual semi-colon Write a method called DisplayPersonalInfo(). This method will display your name, school, program and your favorite course. Call the DisplayPersonalInfo() method from your program Main() method Write a method called CalculateTuition(). This method will prompt the user for the number of courses that she is currently taking and then calculate and display the tuition cost. (cost = number of course * 569.99). Call the CalculateTuition() method two times from the same Main() method as in question 1. Write a method call CalculateAreaOfCircle(). This method will prompt the user for the radius of a circle and then calculate and display the area.[A = πr2].Call the CalculateAreaOfCircle() method twice from the same Main() method as in question 1. Use Math.Pi for the value of π Write a method call…Write the method header for a method named ShowRetailPrice. The method should include parameter variables for a list price and a markup percentage. Write the method so that the default argument for the markup percentage is set to 50 percent.According to the following, which statement is true?private void ShowAnimalInfo(Animal animal) { } Question 12 options: It has an Animal variable as its parameter. You cannot pass an Animal object to the method when you call it. You cannot pass Dog objects although Dog is a class derived from Animal. All of the above.
- Use method which take a string parameter. Method must be named hasRepeat and string parameter. Don't reject please And give me write code to fill. Attach screenshot as wellThe following statement calls an object’s method. What is the name of the method? What is thename of the variable that references the object? wallet.get_dollar()The Financial officer at RGI wants you to develop an application that will evaluate the company’s asset’s annual depreciation using the double-declining balance and sum-of-the years’ digit method. The Financial officer will enter the asset’s cost, useful life (in years), and salvage value (which is the value of the asset at the end of its useful life). The sample of the application can be seen in Figure 2. The interface provides text boxes for entering the asset cost and salvage value. It also provides a list box for selecting the useful life, which ranges from 3 to 20 years. The depreciation amounts are displayed in the list boxes. (You can use the DDB and SYD functions in Microsoft Excel to verify the amounts shown in Figure 2 are correct). Create a windows form application using the name RGI annual asset depreciation App. You can use the visual basic’s Financial.DDB method to calculate the double-declining balance depreciation and use its Financial.SYD method to calculate the…