MindTapV2.0 for Farrell's Java Programming with 2021 Updates, 9th Edition [Instant Access], 1 term
9th Edition
ISBN: 9780357505540
Author: Farrell; Joyce
Publisher: Cengage Learning US
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
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”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
JAVA:
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…
Chapter 2 Solutions
MindTapV2.0 for Farrell's Java Programming with 2021 Updates, 9th Edition [Instant Access], 1 term
Ch. 2 - Prob. 1RQCh. 2 - Prob. 2RQCh. 2 - Prob. 3RQCh. 2 - Prob. 4RQCh. 2 - Prob. 5RQCh. 2 - Prob. 6RQCh. 2 - Prob. 7RQCh. 2 - Prob. 8RQCh. 2 - Prob. 9RQCh. 2 - Prob. 10RQ
Ch. 2 - Prob. 11RQCh. 2 - Prob. 12RQCh. 2 - Prob. 13RQCh. 2 - Prob. 14RQCh. 2 - Prob. 15RQCh. 2 - Prob. 16RQCh. 2 - Prob. 17RQCh. 2 - Prob. 18RQCh. 2 - Prob. 19RQCh. 2 - Prob. 20RQCh. 2 - Prob. 1PECh. 2 - Prob. 2PECh. 2 - Prob. 4PECh. 2 - Prob. 5PECh. 2 - Prob. 6PECh. 2 - Prob. 7PECh. 2 - Prob. 8PECh. 2 - Prob. 9PECh. 2 - Prob. 10PECh. 2 - Prob. 11PECh. 2 - Prob. 12PECh. 2 - Prob. 13PECh. 2 - Prob. 14PECh. 2 - Prob. 15PECh. 2 - Prob. 16PECh. 2 - Prob. 1GZCh. 2 - Prob. 3GZCh. 2 - Prob. 1CPCh. 2 - Prob. 2CP
Knowledge Booster
Similar questions
- Choose the best data type for each of the following, so that no memory storage is wasted. Give an example of a typical value that would be held by the variable, and explain why you chose the type you did. the number of years of school you have completed your final grade in this class the population of China the number of passengers on an airline flight one players score in a Scrabble game the number of Electoral College votes received by a U.S. presidential candidate the number of days with below freezing temperatures in a winter in Miami, Florida one teams score in a Major League Baseball gamearrow_forwardAny help would be greatly appreciated!! If you could attached screenshots of the code that would be very helpful!! Write code for the following: Write Python code that uses a loop to prompt the user for five floating point numbers and reports the sum of the floats when the loop ends. Write Python code that defines a void function named divide that takes two numbers as parameters and then prints the quotient accurate to 1 decimal place when the first parameter is divided by the second one. A file named txt is shown on the right. Write Python code that opens this file, reads only the first two lines, and prints “Penny is 19” Penny 19 Kenny 20 Benny 21 Jenny 20arrow_forwardOne way to make sure that a variable has been assigned a value is to __________ the variable with a value when you declare it. a. concatenate b. initialize c. delimit d. restrictarrow_forward
- If int a=5, b=10; (a). what is the value of c= a+++b--; Ans: _____________________ (b). what are the values of a and b respectively after the statement in (a) is executed? Ans: _____________________arrow_forwardHi, the assignment is asking for a code and here is the intructions.arrow_forward15. Given a function that does not return any value, What value is thrown by default when executed in shell. a. int b. bool c. void d. Nonearrow_forward
- PHP ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits. *With user input ($pinNumbers), create a function that takes a string and returns true if the PIN is valid and false if it's not. Examples validatePIN("$1234") ➞ true validatePIN("12345") ➞ false validatePIN("a234") ➞ false validatePIN("") ➞ false Notes ● Some test cases contain special characters. ● Empty strings must return false.arrow_forwardIn Csharp (C#) a) Create a method that creates six random numbers between 10-20 which the method shall then return the numbers generated through reference parameters. b) Create a method that has six parameters and can accept in six numbers, where the function must return true if all numbers are equal to each other from a) c) Create a Method with a timer, it should have a delay of about 150ms. For each Tick event the numbers will randomize themselves as in task a). Have a variable count up the amount of ticks. The Method should be able to be stopped on demand as well through a button click.arrow_forwardJVarrow_forward
- In python, Old-fashioned photographs from the nineteenth century are not quite black and white and not quite color, but seem to have shades of gray, brown, and blue. This effect is known as sepia, as shown in the figures below. Original Sepia Original Image & Sepia Image Write and test a function named sepia that converts a color image to sepia. This function should first call grayscale to convert the color image to grayscale. A code segment for transforming the grayscale values to achieve a sepia effect follows.Note that the value for green does not change. (red, green, blue) = image.getPixel(x, y)if red < 63: red = int(red * 1.1) blue = int(blue * 0.9)elif red < 192: red = int(red * 1.15) blue = int(blue * 0.85)else: red = min(int(red * 1.08), 255) blue = int(blue * 0. 1. GUI TEST 2. CUSTOM TEST 3. IMAGE TESTarrow_forwardpython" You have an Internet connection with a download speed of 41 Megabits per second (Mbps) and you want to calculate how long it will take to download a files based on their size. Write a function named "download_time" that takes an integer as a parameter. The parameter represents the size of a file in Gigabytes that you want to download. The function should return the number of seconds it will take to download that file if your download speed is 41 Megabits per second. To convert the file size from Gigabytes to Megabits remember that 1 Gigabyte equals 1000 Megabytes and that 1 Megabyte equals 8 Megabits.arrow_forwardQ2: The sizeof operator can be used to determine the number of bytes in memory by a variable of a certain type. For example, size of (short) is equivalent to 2. Write a program that displays the memory space required by each fundamental type on screen.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT