1. Write a program that performs arithmetic division. The program will use two integers, a and b (obtained by the user) and will perform the division a/b, store the result in another integer c and show the result of the division using cout. In a similar way, extend the program to add, subtract, multiply, do modulo and power using integers a and b. Modify your program so that when it starts, it asks the user which type of calculation it should do, then asks for the 2 integers, then runs the user selected calculation and outputs the result in a user friendly formatted manner. Sample Run is shown below: a. Enter first number: 15 b. Enter second number: 3 c. The quotient is 5.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 12E: (Program) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question
100%

write in C++

1. Write a program that performs
arithmetic division. The program will
use two
integers, a and b (obtained by the
user) and will perform the division
a/b, store the
result in another integer c and show
the result of the division using cout.
In a
similar way, extend the program to
add, subtract, multiply, do modulo
and power
using integers a and b. Modify your
program so that when it starts, it
asks the user
which type of calculation it should
do, then asks for the 2 integers, then
runs the
user selected calculation and
outputs the result in a user friendly
formatted
manner. Sample Run is shown
below:
a. Enter first number: 15
b. Enter second number: 3
c. The quotient is 5.
2. Basically the same as Problem
Solving #1, but this time, the function
that adds the
numbers should be void, and takes a
third, pass by reference parameter;
then puts
the sum in that
Transcribed Image Text:1. Write a program that performs arithmetic division. The program will use two integers, a and b (obtained by the user) and will perform the division a/b, store the result in another integer c and show the result of the division using cout. In a similar way, extend the program to add, subtract, multiply, do modulo and power using integers a and b. Modify your program so that when it starts, it asks the user which type of calculation it should do, then asks for the 2 integers, then runs the user selected calculation and outputs the result in a user friendly formatted manner. Sample Run is shown below: a. Enter first number: 15 b. Enter second number: 3 c. The quotient is 5. 2. Basically the same as Problem Solving #1, but this time, the function that adds the numbers should be void, and takes a third, pass by reference parameter; then puts the sum in that
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Function Arguments
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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