Java Programming, Loose-Leaf Version
Java Programming, Loose-Leaf Version
9th Edition
ISBN: 9781337685900
Author: FARRELL, Joyce
Publisher: Cengage Learning
Expert Solution & Answer
Book Icon
Chapter 2, Problem 8RQ
Program Description Answer

The value 137.68 can be held by the variable types “float and double”.

Hence, the correct answer is option “D”.

Blurred answer
Students have asked these similar questions
#01.
A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer’s final score is determined by dropping the highest and lowest score received, then averaging the 3 remaining scores. Write a program that uses these rules to calculate and display a contestant’s score. It should include the following functions: • void getJudgeData() should ask the user for a judge’s score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the 5 judges. • double calcScore() should calculate and return the average of the 3 scores that remain after dropping the highest and lowest scores the performer received. This function should be called just once by main and should be passed the 5 scores.Two additional functions, described below, should be called by calcScore, which uses the returned information to determine which of the scores to drop.•…
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 inpatient or an outpatient. If the patient was an inpatient, 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 outpatient: • 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 inpatient data, while the other function accepts arguments for outpatient information. Both functions should return the total charges and display it for the user. After the total charges have been calculated and displayed, write the result to a file, PatientReport.txt. You can use the techniques you learned in Chapter…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT