design types program, it may display the following messages: Problems @ Javadoc Declaration Console X Data Hierarchy Conversion [Java Application] C:\Program Files\Eclipse Foundation\b 1. This is to show assignment conversion: Enter an int for a: 3 Converted an int to a double by assignment. int a is 3 double b is 3.0 2. This is to show promotion coversion: Enter an int for c: 5 Enter a double for d: 2.0 Assign c/d to e. int c is 5 double d is 2.0 output e is 2.5 3. This is to show casting conversion: Enter a double for f: 5.7 Enter an int for g: 2 Assign f/g to h. double f is 5.7 int g is 2 output h is 2 When you run our program, the numbers must be typed from input but not be assigned in your program. You can type the same numbers as in the example or you may type other numbers, but please display all the three data conversions.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
100%
Please design a problem to show the three types of data conversions. For example, if you run the
program, it may display the following messages:
Problems @ Javadoc Declaration Console X Data Hierarchy
<terminated> Conversion [Java Application] C:\Program Files\Eclipse Foundation\b
1. This is to show assignment conversion:
Enter an int for a: 3
Converted an int to a double by assignment.
int a is 3
double b is 3.0
2. This is to show promotion coversion:
Enter an int for c: 5
Enter a double for d: 2.0
Assign c/d to e.
int cis 5
double d is 2.0
output e is 2.5
3. This is to show casting conversion:
Enter a double for f: 5.7
Enter an int for g: 2
Assign f/g to h.
double f is 5.7
int g is 2
output h is 2
When you run our program, the numbers must be typed from input but not be assigned in your
program. You can type the same numbers as in the example or you may type other numbers, but
please display all the three data conversions.
Transcribed Image Text:Please design a problem to show the three types of data conversions. For example, if you run the program, it may display the following messages: Problems @ Javadoc Declaration Console X Data Hierarchy <terminated> Conversion [Java Application] C:\Program Files\Eclipse Foundation\b 1. This is to show assignment conversion: Enter an int for a: 3 Converted an int to a double by assignment. int a is 3 double b is 3.0 2. This is to show promotion coversion: Enter an int for c: 5 Enter a double for d: 2.0 Assign c/d to e. int cis 5 double d is 2.0 output e is 2.5 3. This is to show casting conversion: Enter a double for f: 5.7 Enter an int for g: 2 Assign f/g to h. double f is 5.7 int g is 2 output h is 2 When you run our program, the numbers must be typed from input but not be assigned in your program. You can type the same numbers as in the example or you may type other numbers, but please display all the three data conversions.
Expert Solution
steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Knowledge Booster
Data members
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning