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
1. Consider the floating point numbers with B = 2,p = 5, -6ses7.What is the normalization of decimal number 0.25?
Remind: the normalization of a certain real number means the conversion of it to a floating-point form with do # 0 do = 1
%3D
1. Express the following Excess-3 codes as decimals: 1000001101102 and 01111100100101102.
2. Express the following decimal numbers in Excess-3 code form: 24510, 73910, and 456710.
Base 8 representation of numbers is called “octal”, and uses only digits 0 through 7.Give the following equivalent numbers for octal number 1473 in each binary,decimal, and hexadecimal representation.
a. Binary: _____________________b. Decimal: _________________________c. Hexadecimal: _____________________
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
- 6. Convert the following single-precision floating point numbers from hexadecimal to decimal or from decimal to hexadecimal. You may leave your answer as an expression. a. 8.25 b. 0x00000F00arrow_forward2) What is the largest binary number that can be expressed with 16 bits? What are the equivalent decimal and hexadecimal numbers? 3) Convert the hexadecimal number 64CD to binary, and then convert it frombinary to octal.arrow_forward4. Convert the following hexadecimal numbers to their binary equivalents: a. 1C b. 1FC C. A64 d. 239.4 5. Convert the following binary numbers to their hexadecimal equivalents: a, 1001.1111 b. 110101.011001 c. 10100111.111011 d. 1101001.01011arrow_forward
- 4- Which of the following values is the decimal representation of the hexadecimal number 4D? a. 01001101 b. 77 c. 178 d. 4D e. B2 f. 10110010arrow_forwardWhich of the following are correct literals for floating-point numbers? 12.3, 12.3e+2, 23.4e-2, –334.4, 20.5, 39F, 40Darrow_forward1. Express the following numbers in decimal: (26.24) 8arrow_forward
- a) How is the number 42.5 represented in memory as a single precision floating point number, represent it in hexadecimal format? b) How is the number 18.25 represented in memory as a single precision floating point number, show it in hexadecimal format?arrow_forward11. Create an uninitialized data declaration for an 8-bit unsigned integer?arrow_forward.Perform octal arithmetic operation to get the sum of this two numbers: (32.1)base 10 + (A1.4)base 12. Express the sum in base 8arrow_forward
- 4) For IEEE 754 single precision floating point numbers, what is the exponent of a denormalized floating point number in decimal ? Question options: a. -126 b. -127 c. 126 d. 127 5) For IEEE 754 single precision floating point numbers, how many bits for mantisa? Question options: a. 7 b. 31 c. 23 d. 8 6) For IEEE 754 single precision floating point numbers, which of following is an example of NAN ? Question options: a. 1 111 1 111 0000 0000 1101 0000 0000 0000 b. 0 111 1 111 1000 0000 1101 0000 0000 0000 c. 0 111 1 111 1000 0000 0000 0000 0000 0000 d. 1 111 1 111 0000 0000 0000 0000 0000 0000 e. None of the above 7) Assume we use 8-bit cell to store floating point numbers, 1 bit for…arrow_forward1.What is the decimal representation of each of the following signed binary numbers? 10000000 11001100 10110111 2.What are the hexadecimal and decimal representations of the ASCII character capital B? 3.What are the hexadecimal and decimal representations of the ASCII character capital G? 4.Challenge: What is the largest decimal value you can represent, using a 129-bit unsigned integer? 5.Challenge: What is the largest decimal value you can represent, using a 86-bit signed integer?arrow_forward4. Y = 60252.5 Find the equivalent of Y in binary, octal, and hexadecimal bases. Calculate and show the Y number translated into a 32-bit Single Precision floating point number.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education