Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 4, Problem 18RQ
Program Plan Intro
To find an expression from the given expression which have condition, the value of itemNumber is 1 or 2 and the value of quantity is 12 and price after adding tax.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Flowchart to calculate price of weighted Musang King Durian
Write a C++ program to calculate the price of the Musang King Durian as specified by theabove flowcharts. Table 1 is the test cases that you can use to test the program and the details of theinput/output style of the program.
Write a set of functions that calculate the cost of movie tickets for a family. These functions should use a pass-by-reference variable that accesses the double running_total variable in main().
Using a loop, keep displaying the ticket prices for each age group:
Something like:
Model Hall Movie Ticket Box Office
Under Age 3 (free)
Ages 3-11 ($10.25)
Ages 12-54 ($15.50)
Age 55 or older ($12)
If 4 tickets are purchased (not counting under age 3) then 20% discount
Within the loop:
Keep asking the user to input the moviegoer age and to enter a zero for the age when they are finished inputting all the family members.
Also, within the loop:
Keep a running_total that is output to the screenafter each age has been entered.
This running_total should be accessed through the functions using apass-by-reference variable.
Finally, after the looping is done:
Calculate the total cost, including a 7.5% sales tax, and output it to the screen.
Problem 7
Chapter 4 Solutions
Microsoft Visual C#
Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - Prob. 3RQCh. 4 - If the following code segment compiles correctly,...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - What is the output of the following code...Ch. 4 - Which of the following expressions is equivalent...Ch. 4 - Which of the following expressions assigns true to...
Ch. 4 - Which of the following expressions is equivalent...Ch. 4 - How many case labels would a switch statement...Ch. 4 - Prob. 13RQCh. 4 - Prob. 14RQCh. 4 - Which of the following is equivalent to the...Ch. 4 - Which of the following C# expressions is...Ch. 4 - Which of the following C# expressions means, If...Ch. 4 - Prob. 18RQCh. 4 - Prob. 19RQCh. 4 - Which of the following C# expressions results in...Ch. 4 - Write a program named CheckCredit that prompts...Ch. 4 - Write a program named Twitter that accepts a users...Ch. 4 - Write a program named Admission for a colleges...Ch. 4 - The Saffir-Simpson Hurricane Scale classifies...Ch. 4 - a. Write a program named CheckMonth that prompts a...Ch. 4 - Account numbers sometimes contain a check digit...Ch. 4 - Write a program named GuessingGame that generates...Ch. 4 - In the game Rock paper Scissors, two players...Ch. 4 - Create a lottery game application named Lottery....Ch. 4 - Each of the following files in the Chapter.04...Ch. 4 - In Chapter 2, you created an interactive...Ch. 4 - In Chapter 2, you created an interactive...
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
- Could you write function comments for def quadratic(a,b,c,x) And def print_quad(a,b,c,x) Please follow the comment rule.arrow_forwardIn c++arrow_forwardFor this part of the assignment, you will create functions to calculate a person's body mass index (BMI).The formula you must use for this calculation is: BMI= (weight/height * height) **************Where weight is measured in kilograms and height is measured in meters. Do This: Write two functions: bmi() and imperial_bmi() that computes and returns the body mass index (BMI) of an individual. The first function - bmi takes the height and weight using metric measurements (centimeters and kilograms) and the second function (imperial_bmi) uses imperial measurements (inches and pounds). We will be using the auto-grader for this part of the assignment so your functions must match the specs precisely.Note: The BMI (metric) formula (given above) uses meters but our function for the bmi() takes centimeters as one of its parameters: bmi(height, weight): ''' Function -- bmi Takes as input height and weight in cm and kg and returns the BMI value Parameters:…arrow_forward
- Needs to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.arrow_forwardIn C++arrow_forwardIn what situation should you overload the = operator?arrow_forward
- Please due in C++ The user should give the company name and numbers. If possible can you give a comment on the code please and thank you A sample run is as follows: Enter the company name: TC Energy Enter TC Energy's stock symbol: TRP.TO Enter TC Energy's current stock price: 55 Enter TC Energy's annual dividend per share: 3.24 Enter the company name: Canadian Utilities Enter Canadian Utilities's stock symbol: CU.TO Enter Canadian Utilities's current stock price: 31.70 Enter Canadian Utilities's annual dividend per share: 1.76 Enter the company name: Bank of Nova Scotia Enter Bank of Nova Scotia's stock symbol: BNS.TO Enter Bank of Nova Scotia's current stock price: 70.08 Enter Bank of Nova Scotia's annual dividend per share: 3.60 Enter the company name: TransAlta Renewables Enter TransAlta Renewables's stock symbol: RNW.TO Enter TransAlta Renewables's current stock price: 21.75 Enter TransAlta Renewables's annual dividend per share: 0.94…arrow_forwardUsing c++ write the function to find if target is visible to the camera, you may create and use helper functions. struct Vec3{ float x, y, z;};struct Quaternion{ float x, y, z, w;};struct AABB{ Vec3 min, max;};struct SFrustum{// code here};struct SCamera{ Vec3 position; Quaternion rotation; SFrustum relativeFrustum;}; // Function that returns true if target position is visiblebool IsVisible(const SCamera& camera, const Vec3& targetPosition, const AABB* obstacles, size_t numObstacles){// Answer here}arrow_forwardPakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to5). Once per day, each agent passes in a slip for each different type of product sold. Every agentpasses in between 0 to 5 slips each day. Each slip has the following information on it: The agent number The product number Total rupees of that product sold that day.Write a program in C++ that will read all this information for last month’s sales and brief thetotal sales by agent by product. The output should be in tabular form.arrow_forward
- Tenaga Nasional Berhad charges electricity usage according to the following table: |Tariff Category Unit Used Rate per kilowatt per hour(kWh) Domestic (D) First 200 kWh 10 cents Next 100 kWh 12 cents Over 300 kWh 9 cents Commercial (C) First 200 kWh 20 cents Next 100 kWh 22 cents Over 300 kWh 18 cents Write a complete C++ program that prompts user to enter the following data: • Customer name • Customer address • Customer category • The units used The program will calculate the bill amount for each customer and prints the bilI. This process will continue until the user requests to stop. Then, generate a report that displays the following information: • Total number of customers in each category • Total electricity used in each category • Total collection in Ringgit Malaysia (RM) for Tenaga Nasional Berhadarrow_forwardThe textbook says that when you enter the expression ._doc_ It retrieve the docstring for the function. I tried it and it doesn’t work.arrow_forwardWhy would you use a VLOOKUP function as oppose to a Nested Ifs statement?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 LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,