EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 2, Problem 18RQ
Program Description Answer

The correct assignment in Java is “double value = 2.12;”.

Hence, the correct answer is option “C”.

Blurred answer
Students have asked these similar questions
int i = 10; int j = 4; int k = i / j; int l = j % i; What is k and l?
#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!)
The following variables have been initialized for you: int a; float f; double d; You have to cast the variable into different data types as follows: Cast a as float to a variable x. Cast f as an integer to a variable y. Cast d as float to a variable z. Hint: You have to initialize the variables x,y and z of proper data types
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
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