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 18RQ
Program Description Answer
The correct assignment in Java is “double value = 2.12;”.
Hence, the correct answer is option “C”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
#include
int main()
{
float Bread = 1.09, Water = 2.18, Banana = 1.00, Meat = 7.99;
//Unit for bread is loaf, for water is bottle, for banana and meat are Ibs.
int Bread_num=2, Water_num=3, Banana_num=2, Meat_num = 1;
float Cost = Bread"Bread_num+Water*Water_num+Banana*Banana_num+Meat"Meat_num;
float Grocery_tax = 0.07;
Other part of this line is missing.
Other part of this line is missing as well.
[printf(
[printf(
getchar(); return O; }
-----=-SCRIPT ENDS HERE
====
so we can have
You have 2 loaves of bread, 3 bottles of water, 2 lbs of Banana, and 1 lbs of Meat.
It is 18.71 before tax but you need to pay extra 1.31 for tax.
as the output when we run it!
Just type in two line, please! (You do not have to type in the whole script!)
In Java:
int j;
for (int i = 0; i < 5; i++)
{j = 2*j*i;}
What is j?
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
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
- int test(int *x, int y){ x=&y; return(*x+y); } int main(void) { int x=1, y=6; test(&y, x); printf("%d %d %d", x, test (&y,x),y); return 0; } 1 2 6arrow_forwardNeeds 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_forwardKindly solve this C++ program and follow all the instructions! Please let me know how should I contact you for further assistance. Thank you for your help!arrow_forward
- Determine the value ranges that may be represented by the following data types: int short int long int float double I am very thankful to the expert that can help me :)arrow_forward1. above? #include int c = 2; int f1(int a, int b); int f2(int a, int b); int main() { } int { int a = 3; int b; b = f1(c, a); printf("%d", b); return 0; f1(int a, int b) int d = f2(b,a); return d; } int f2(int a, int b) { } int d = a*b + c*b; return d; ) What is the output of the program shownarrow_forwardSelect all integer type names: Hint: Please follow the exact wording in the read signed long int unsigned int signed short int long double chararrow_forward
- Group Project In Java(Airline System) A small airline has just purchased a computer for its new automated system. You have been asked to develop the new system. You are to write an application to assign seats on each flight of the airline’s planes.1. Your application should display the following alternatives: "Please type 1 for Roundtrip" "Please type 2 for One-way"2. Enter passenger’s information (name, gender, phone number,...etc)3. Enter departure and destination airports4. Enter depart and return date(if roundtrip)5. Selection for the seatIf the user types 1, your application should provide inputs for both departure and destination airports and corresponding dates. If the user types 2, your application should only provide inputs for departure airport and depart date. Your application should also display a set of inputs for passenger information.Use a one-dimensional array of primitive type boolean to represent the seating chart of the plane. Initialize all the elements of the…arrow_forwardC++ Assignment: In India McDonald's has the n number of customers and they are famous for their taste and quality so they plan to Organise the challenge for foody people. What is the challenge is? you have taken a food challenge from the Chef and now you have to eat directly the Y burgers. You will eat as follows: At the first minute you will eat exactly the X burgers and every minute after that you will eat twice the number of burgers you ate the minute before. As you can get tired of food, Chef also lets you take a break from eating for one minute. When you start eating again after a break, your food streaks are reset, which means that in the first minute after the break you will eat X burgers and every minute after that you will eat the burgers you ate twice the last minute. Allow a1, a2, ., let it be your meal length in minutes. The cook needs to have all the ai different in pairs. Get the minimum number of minutes you need to eat Y burgers directly or decide that it is not…arrow_forwardCan this be done in Java and not C++arrow_forward
- X3: inlTo10 Write a function in Java that implements the following logic: Given a number n, return true if n is in the range 1..10, inclusive. Unless "outsideMode" is true, in which case return true if the number is less or equal to 1, or greater or equal to 10.arrow_forwardH7.arrow_forwardWhat is wrong with this code? int Money4Me( int dollars ){ int pennies, coins; coins = dollars * 100;}arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
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,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Files & File Systems: Crash Course Computer Science #20; Author: CrashCourse;https://www.youtube.com/watch?v=KN8YgJnShPM;License: Standard YouTube License, CC-BY
UNIX Programming (Part - 10) The File System (Directories and Files Names); Author: ITUTEES;https://www.youtube.com/watch?v=K35faWBhzrw;License: Standard Youtube License