Write a program that prompts the user to enter a decimal number that has two-digits decimal part and a three-digits integer part. The program exchanges the integer and decimal parts forming a new decimal number, and then prints the new number, as shown in the following input/output sample. When you are done: Download your code. It will save the file main.cpp and rename the file to Lab4_Ex1.cpp. This is very important so that you can always access the code later. How to Submit: Select all the code using Ctrl + A/ Cmd + A. Copy the code using Ctrl + C / Cmd + C. Paste the code in the answer box using Ctrl + V/ Cmd + V on the blackboard. Move to the next question or press the Save and Submit button. Sample input / output: Enter a decimal number: 238.76 The new number is 76.238

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
Write a program that prompts the user to enter a decimal number that has two-digits decimal part and a three-digits integer part.
The program exchanges the integer and decimal parts forming a new decimal number, and then prints the new number, as shown in the following
input/output sample.
When you are done:
Download your code. It will save the file main.cpp and rename the file to Lab4_Ex1.cpp.
This is very important so that you can always access the code later.
How to Submit:
Select all the code using Ctrl + A/ Cmd + A.
Copy the code using Ctrl + C / Cmd + C.
Paste the code in the answer box using Ctrl + V/ Cmd + V on the blackboard.
Move to the next question or press the Save and Submit button.
Sample input / output:
Enter a decimal number: 238.76
The new number is 76.238
Transcribed Image Text:Write a program that prompts the user to enter a decimal number that has two-digits decimal part and a three-digits integer part. The program exchanges the integer and decimal parts forming a new decimal number, and then prints the new number, as shown in the following input/output sample. When you are done: Download your code. It will save the file main.cpp and rename the file to Lab4_Ex1.cpp. This is very important so that you can always access the code later. How to Submit: Select all the code using Ctrl + A/ Cmd + A. Copy the code using Ctrl + C / Cmd + C. Paste the code in the answer box using Ctrl + V/ Cmd + V on the blackboard. Move to the next question or press the Save and Submit button. Sample input / output: Enter a decimal number: 238.76 The new number is 76.238
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning