Once you have Step 1 working properly, extend your program's capability by adding several lines that prompt the user for a second number and then prints the sum and product of the two numbers that were entered as shown in the sample below. Sample run Input: 4 Run: Enter an integer: 4 The triple of 4 is 12 The square of 4 is 16 Voila! Enter another integer: 6 (4 + 6) is 10 (4 * 6) is 24 That is all! When you work in Develop mode, remember to place 4 and 6 in separate lines under Enter program input (optional).

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Java Program:

Your job is to write a program called BasicIO that will perform simple input/output and math operations. Complete your program by following the steps below. 

Step 2
Once you have Step 1 working properly, extend your program's capability by adding several lines that prompt the user for a second number
and then prints the sum and product of the two numbers that were entered as shown in the sample below.
Sample run
Input:
4
6
Run:
Enter an integer: 4
The triple of 4 is 12
The square of 4 is 16
Voila!
Enter another integer: 6
is 10
(4 + 6)
(4 *
6) is .
That is all!
When you work in Develop mode, remember to place 4 and 6 in separate lines under Enter program input (optional).
Notes
Make sure to use a println Statement to print the last line of the output.
Transcribed Image Text:Step 2 Once you have Step 1 working properly, extend your program's capability by adding several lines that prompt the user for a second number and then prints the sum and product of the two numbers that were entered as shown in the sample below. Sample run Input: 4 6 Run: Enter an integer: 4 The triple of 4 is 12 The square of 4 is 16 Voila! Enter another integer: 6 is 10 (4 + 6) (4 * 6) is . That is all! When you work in Develop mode, remember to place 4 and 6 in separate lines under Enter program input (optional). Notes Make sure to use a println Statement to print the last line of the output.
Step 1
First, prompt the user to enter an integer value as shown below. Be sure you clearly understand which part of the sample run below is
generated by the computer versus which is just input typed in the by the user. Your program should then print the value tripled as well as
the value squared as shown below. You can simply compute the square by multiplying the value input by itself.
Sample run
Input:
4
Run:
The triple of 4 is 12
The square of 4 is 16
Voila!
When you work in Develop mode, remember to place 4 under Enter program input (optional). Since the output will not contain the user
input part of the run (i.e., the user typing 4 and pressing the Enter key), the result of the execution of the program should look like the
following:
Enter an integer: The triple of 4 is 12
The square of 4 is 16
Voila!
Transcribed Image Text:Step 1 First, prompt the user to enter an integer value as shown below. Be sure you clearly understand which part of the sample run below is generated by the computer versus which is just input typed in the by the user. Your program should then print the value tripled as well as the value squared as shown below. You can simply compute the square by multiplying the value input by itself. Sample run Input: 4 Run: The triple of 4 is 12 The square of 4 is 16 Voila! When you work in Develop mode, remember to place 4 under Enter program input (optional). Since the output will not contain the user input part of the run (i.e., the user typing 4 and pressing the Enter key), the result of the execution of the program should look like the following: Enter an integer: The triple of 4 is 12 The square of 4 is 16 Voila!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
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