EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
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
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
4 -A mathematician and discovered a number which have unique properties. As he is not decided any name to that number, so for the time being we call that number ‘Cuboid’. A unique property of Cuboid is that, if we break that number into individual units like breaking 153 into 1, 5 and 3 and take their individual cube, then the sum would be the same as original number being given. Your task is to ask the user an integer and print weather the digit entered is Cuboid or not.
(Python program)
The Body Mass Index – BMI is a parameter used to measure the health status of an individual. Various BMI values depicts how healthy or otherwise a person is. Mathematically BMI = WEIGHT/ HIEGHT * HEIGHT
Write a java program using either JOptionPane or Scanner to collect the following values of an individual:
1.a. Namea
b. Weight
c. Height
2. Compute the BMI of that individual
3. Make the following decisions if:
a. BMI < 18.5 is under weight
b. BMI >=18.5 but <25 considerably healthy
c. BMI >=25 but <30 overweight
d. BMI >= 30 but <40 Obesity
e. BMI >= 40 Morbid Obesity
4. Display the results of the individual 5. Explain your answer
Write an application that finds the smallest of several integers. Assume that the first value read specifies the number of values to input from the user.
Chapter 2 Solutions
EBK JAVA PROGRAMMING
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. 1GZCh. 2 - Prob. 2GZCh. 2 - Prob. 1CPCh. 2 - Prob. 2CP
Knowledge Booster
Similar questions
- In Chapter 4, you created a program that generates a random number, allows a user to guess it, and displays a message indicating whether the guess is too low, too high, or correct. Now, create a modified program called GuessingGame2 in which the user can continue to enter values until the correct guess is made. After the user guesses correctly, display the number of guesses made. Recall that you can generate a random number whose value is at least min and less than max using the following statements: Random ranNumber = new Random(); int randomNumber; randomNumber = ranNumber.Next(min, max);arrow_forwardWrite 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…arrow_forwardThe first option of your program will prompt the user to enter a positive binary number (base 2 -- I's and O's only) of no more than 6 digits. Read this value as an int type value and your program must make sure that it is indeed a binary number (only I's and Os). If it isn't, then the user is prompted again. If it is binary, then your program is to calculate the equivalent decimal value (base 10 -- the number system). MSB Binary Digit LSB 256 128 64 32 16 4 2 1 Representation of a binary number So for example, converting a Binary to Decimal number would be: Decimal Digit Value 256 128 64 32 16 8 4 2 Binary Digit Value O I1 o 0 1 0 By adding together ALL the decimal number values from right to left at the positions that are represented by a "1" gives us:(256) + (64) + (32) + (4) + (1) = 35710 or three hundred and fifty-seven as a decimal number. The second option of your program will prompt the user to enter 3 positive numbers in the rangel to 10, and will tell the user whether the…arrow_forward
- Mark Daniels is a carpenter business who creates personalized house signs. He wants an application to compute the price of any sign a customer orders , based on the following factors:• The minimum charge for all signs is $30.• If the sign is made of oak, add $15. No charges added for pine.• The first 6 letters or numbers are included in the minimum charge; there is a $3 charge for each additional character.• Black or white characters are included in the minimum charge; there is an additional $12.00 charge for gold leafing.Design A flow chart and pseudocode for the following:• A program that accepts data for an order number, customer name , wood type, number of characters, and color of characters. Display all the entered data in the final price for the sign.arrow_forwardUse the Bash shell for the completion of this project.Develop a shell scripting application that allows the user to perform some advanced mathematicaloperations: Task 3: Find the numbers that can be expressed as the product of two nonnegative integers in succession and print them in increasing order. For each number found the program should check whether the number is a multiple of 5 and indicate this in the output. (For example, 30 is such anumber as it can be written as the product of 5 and 6 (30=5x6), which are two numbers in succession.) The user should specify how many such numbers they want to print.arrow_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
- In C# code: Write a program that will help an elementary schoolstudent learn multiplication. Use a Random object to produce two positive one-digitintegers. The program should then prompt the user with a question, such asHow much is 6 times 7 The student then inputs the answer. Next, the program checks the student’s answer. Ifit’s correct, display the message "Very good!" and ask another multiplication question.If the answer is wrong, display the message "No. Please try again." and let the studenttry the same question repeatedly until the student gets it right. A separate methodshould be used to generate each new question. This method should be called oncewhen the app begins execution and each time the user answers the question correctly.Program will stop any time students enter -1. One problem in CAI environments is student fatigue. This can be reduced by varyingthe computer’s responses to hold the student’s attention. The program should usevarious comments to be displayed for each…arrow_forwardDesign and implement an application that plays the High-Low guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive) then repeatedly prompt the user to guess the number. Every time the user guess, inform him/her whether the guess is correct, or the guess is high or low.Continue accepting guesses until the user guesses correctly or chooses to surrender. Use a sentinel value to determine whether the user wants to quit. Count the number of guesses and display that value when the user guesses correctly. At the end of each game (either by quitting or a correct guess) prompt to determine whether the user wants to play again. Continue playing until the user chooses to stop. When the user stops playing, display the number of correct guesses and surrenders.The c++program should use suitable selection and repetition structures. The input process, guessing process and output must be organized into appropriate functions.arrow_forwardWrite 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• Charges for hospital services (lab tests, etc.)• Hospital medication charges.If the patient was an out-patient the following data should be entered:• Charges for hospital services (lab tests, etc.)• Hospital medication charges.Use a single, separate function to validate that no input is less than zero. If it is, it should be re-entered before being returned.Once the required data has been input and validated, 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 data. Both functions should return the total charges.arrow_forward
- QUESTION 18 Int xt= 200 int yt 100; Int d1, d2; LAm( mov EAX, x1: mov EBX, y1: push EBX pop ECX mov d2, ECX: mov d1. EAX: What is d2 in decimal format? 100 1200 400 O 300 QUESTION 19 Int xt200; int yt 100; int 0, z1 int d1, 2 mov EAX xt: mov EBX vt: mov a0, ESP, assume inta ESP aoss push EAX mov d1, EAX mov z1, ESP push EBX mov 2, EX mov 2. ESP What is dt n decimal format? 200 0.100 QUISTION 20 CA N end C4 A ws al annarrow_forward. Actions taken by the computer when a function is called, such as allocating memory for parameters and local variables, are referred to as _______________.a. overheadb. set uarrow_forwardWrite an application that prompts a user for two integers and displays every integer between them. Display There are no integers between X and Y if there are no integers between the entered values. Make sure the program works regardless of which entered value is larger.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,
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,