Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 2.10, Problem 2.10.2CP
Program Plan Intro
Floating point:
- The values that contain decimal part in them are called as floating point literals.
- They are two basic types for java floating point numbers.
- Float
- Double
Float:
It holds single precision number format.
It can hold 4 bytes of data.
Example:
//declaration of a float value
float a = 2.356f;
Double:
It holds double precision number format.
It can hold 8 bytes of data.
Example:
//declaration of a double value
double a = 2.356;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the following are correct literals for floating-point numbers? 12.3, 12.3e+2, 23.4e-2, –334.4, 20.5, 39F, 40D
Which of the following is NOTWhat is the highest value in base 10 if a number is represented in 8,4,2,-1 code a number representation in Base 11?
Which of the following is bitwise not operator?i) .ii) *iii) ::iv) ~
Chapter 2 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 2.2 - Identify and fix the errors in the following code:...Ch. 2.3 - How do you write a statement to let the user enter...Ch. 2.3 - Prob. 2.3.2CPCh. 2.4 - Prob. 2.4.1CPCh. 2.5 - Identify and fix the errors in the following code:...Ch. 2.6 - Identify and fix the errors in the following code:...Ch. 2.7 - Prob. 2.7.1CPCh. 2.8 - Prob. 2.8.1CPCh. 2.8 - Translate the following algorithm into Java code:...Ch. 2.9 - Prob. 2.9.1CP
Ch. 2.9 - Prob. 2.9.2CPCh. 2.9 - Prob. 2.9.3CPCh. 2.9 - Prob. 2.9.4CPCh. 2.9 - Prob. 2.9.5CPCh. 2.9 - Prob. 2.9.6CPCh. 2.9 - Write a statement to display the result of 23.5.Ch. 2.9 - Suppose m and r are integers. Write a Java...Ch. 2.10 - How many accurate digits are stored in a f1oat or...Ch. 2.10 - Prob. 2.10.2CPCh. 2.10 - Prob. 2.10.3CPCh. 2.10 - Which of the following are correct literals?...Ch. 2.11 - How would you write the following arithmetic...Ch. 2.12 - Prob. 2.12.1CPCh. 2.13 - Prob. 2.13.1CPCh. 2.14 - Which of these statements are true? a. Any...Ch. 2.14 - Show the output of the following code: int a = 6;...Ch. 2.15 - Prob. 2.15.1CPCh. 2.15 - Prob. 2.15.2CPCh. 2.15 - Show the following output: float f =12.5F; int i =...Ch. 2.15 - If you change (int) (tax 100) / 100.0 to (int)...Ch. 2.15 - Prob. 2.15.5CPCh. 2.15 - Write an expression that rounds up a double value...Ch. 2.16 - How would you write the following arithmetic...Ch. 2.17 - Show the output of Listing 2.10 with the input...Ch. 2.18 - Can you declare a variable as int and later...Ch. 2.18 - Prob. 2.18.2CPCh. 2.18 - Will overflow cause a runtime error?Ch. 2.18 - Prob. 2.18.4CPCh. 2 - (Convert Celsius to Fahrenheit) Write a program...Ch. 2 - (Compute the volume of a cylinder) Write a program...Ch. 2 - (Convert feet into meters) Write a program that...Ch. 2 - (Convert pounds into kilograms) Write a program...Ch. 2 - (Financial application: calculate tips) Write a...Ch. 2 - (Sum the digits in an integer) Write a program...Ch. 2 - (Find the number of years) Write a program that...Ch. 2 - (Current time) Listing 2.7. ShowCurrentTime.java,...Ch. 2 - (Physics: acceleration) Average acceleration is...Ch. 2 - (Science: calculating energy) Write a program that...Ch. 2 - (Population projection) Rewrite Programming...Ch. 2 - (Physics: finding runway length) Given an...Ch. 2 - (Financial application: compound value) Suppose...Ch. 2 - (Health application: computing BMI) Body Mass...Ch. 2 - (Geometry: distance of two points) Write a program...Ch. 2 - (Geometry: area of a hexagon) Write a program that...Ch. 2 - (Science: wind-chill temperature) How cold is it...Ch. 2 - (Print a table) Write a program that displays the...Ch. 2 - (Geometry: area of a triangle) Write a program...Ch. 2 - (Financial application: calculate interest) If you...Ch. 2 - (Financial application: calculate future...Ch. 2 - (Financial application: monetary units) Rewrite...Ch. 2 - (Cost of driving) Write a program that prompts the...
Knowledge Booster
Similar questions
- What will be the value in EDX after each of the lines marked (a) and (b) execute?.dataone WORD 8002htwo WORD 4321h.codemov edx,21348041hmovsx edx,one ; (a)movsx edx,two ; (b)arrow_forwardWhich of the following is true random numbers produced by the rain function or nondeterministic C++ does not provide any capabilities for generating random numbers that cannot be predicted none of the above C++ 11 provides random numbers capabilities thet can produce nondeterministic random numbers a set of random numbers that can be predictedarrow_forwardq27- Which of the following sequences can be represented as a range in Python? a. 100.0, 200.0, 300.0 b. 103, 106, 109 c. 1, 2, 2, 1 d. 1, 2, 3, 1 e. 100, 100, 100 f. 'x', 'y', 'z'arrow_forward
- Which of the following is used to find the absolute value of the argument in C++? a abs() b fabs() c mod() d ab()arrow_forwardWhich expression is NOT equivalent to the other expressions? 16x^(4)y^(2) (2x^(2)y)^(2) 4x^(4)y^(2)arrow_forwardWhich of these jumps is used with unsigned integers? JL JLE JBE JGarrow_forward
- Question 777 Decode the following HL7 statement: PV1||I||E||||||||||7|||||V20220217-00274^^^^VN|||||||||||||||||09||||||||201102171656<cr> Note: Please decode it and also explain in simple words how you have decoded it so that I can learn and understand decoding of it .....arrow_forwardOCTAVE:Write the following commands: a*b' a'*b' a'*b a/b a.*b 5.*barrow_forwardWhich of the following is the data type used to hold decimal numbers?a. double b. int c. byte D. single to. shortarrow_forward
- Which of the following are correct literals for characters? '1', '\u345dE', '\u3fFa', '\b', '\t'arrow_forwardWhich of the following is still useful for adding numbers? A. EDSAC B. ENIAC C. Abacus D. UNIVAC E. None of the abovearrow_forwardWhich of the following is true? a. C++ is c+2. b. The arithmetic operators * and / are equal. O an is false but b is False O a and B Integers are positive. True a and barrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE L
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L