Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 10, Problem 4RQ
Program Description Answer
The statement “dblDiscount = cellPhone.GetDiscount” is used to invoke the GetDiscount() method.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
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.GetDiscount
Instructions:
IMPORTANT: This is a continuation of the previous part of the project and assumes that you are starting with code that fulfills all requirements from that part of the project.
Modify the your code from the previous part of the project to make it modular.
In addition to the main method, your code must include the following static methods:
Method 1 - displayTitle
A method that creates a String object in memory to hold the text “Computer Hardware Graphics Quality Recommendation Tool” and displays it
Method 2 – getResolutionString
A method that accepts an integer value (1, 2, 3, or 4) that denotes the monitor resolution. The method should return the appropriate String representation of the monitor resolution. For example, if the method is passed an integer value of 1, it should return a String with a value of “1280 x 720”. (See Step 4 of Project 1)
Method 3 – getMultiplierValue
A method that accepts an integer value (1, 2, 3, or 4) that denotes the monitor resolution and…
ExecutorService method "execute":
obtains an ExecutorService that creates new threds as they are needed
notifies the ExecutorService to stop accepting new tasks, but continues executing taskst that have alredy been submitted
All of the above
None of the above
Chapter 10 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 10 - The name of a class file ends with which of the...Ch. 10 - The Inventory class contains a Private variable...Ch. 10 - Prob. 4RQCh. 10 - Which of the following statements is false? a. A...Ch. 10 - A Private variable in a class can be accessed...Ch. 10 - Prob. 7RQCh. 10 - Which of the following is the name of the...Ch. 10 - Prob. 10RQCh. 10 - Prob. 11RQCh. 10 - Prob. 12RQ
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 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.arrow_forwardThe Inventory class contains a Private variable named strId. The variable is associated with the Public ItemId property. An application instantiates an Inventory object and assigns it to a variable named onHand. Which of the following can be used by the application to assign the string "XG45 to the strId variable? a. onHand.ItemId = "XG45" b. ItemId.strId = "XG45" c. onHand.strId = "XG45" d. ItemId.strId = "XG45"arrow_forwardThe operator used to create objects is = += new createarrow_forward
- For each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.arrow_forwardProgramming Exercise 3-5 Tasks Create the BookstoreCredit class. The computeDiscount method calculates a discount based on student's GPA. The BookstoreCredit program displays the discount for the student's information. JO > >arrow_forwardUsing C# in Microsoft Visual Studio create an application that displays the total for a customer’s visit . The application should have the following value-returning methods: OilLubeCharges —Returns the total charges for an oil change and/or a lube job, if any. FlushCharges —Returns the total charges for a radiator flush and/or a transmission flush, if any. MiscCharges —Returns the total charges for an inspection, muf fler replacement, and/or a tire rotation, if any. OtherCharges —Returns the total charges for other services (parts and labor), if any. TaxCharges —Returns the amount of sales tax, if any. Sales tax is 6% and is charged only on parts. If the customer purchases services only, no sales tax is charged. TotalCharges —Returns the total charges. The application should have the following void methods, called when the user clicks the Clear button: ClearOilLube —Clears the check boxes for oil change and lube job. ClearFlushes —Clears the check boxes for radiator flush and…arrow_forward
- // 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) {arrow_forward//Global Constant Global Constant TECH_FEE = 0.05 Module main () //Local Variable Declare Integer studentID, ClassTitles , hoursWorked, numofClass, techFee, totalBill classCost=$150 //Get Student ID Call getStudentID () //Get Class Titles Call getCLassTitles () End Module Module getStudentID () Display "Please enter your Student ID:" Input studentID End Module Module getClassTitles () //Get number of class student wants to add and calculate the total bill Display "One class will be free if you add three classes." Display "How many classes do you want to take? (Limit 3)" Input numofClass if numofClass > 3 then Display "Error: Maximum of 3 Class Allowed" end if while numofClass <= 3 if numofClass == 1 then Display "Please enter the Class Title" Input class1 Set classCost = 150 * numofClass Set techFee = classCost * TECH_FEE Set totalBill = classCost +…arrow_forwardIn programming, objects have ____, which define what the object can do or be made to do. events access modifiers methods parametersarrow_forward
- Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. The flowchart must include a call symbol, at the beginning, to redirect the input to the external data file. create a solution algorithm using pseudocode create a flowchart using RAPTORarrow_forwardPendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. Design a flowchart and psuedocode Pendant Publishing.arrow_forwardC# According to the following statement, __.Random rn = new Random(); Question 1 options: It declares a variable named rn that can be used to reference an object of the Random type. The new operator creates an object in memory and returns a reference to that object. The = operator assigns the reference that was returned from the new operator to the rn object. All of the above.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY