Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please write me a code and make sure its variable and argument are easy to read becaue im new to this program. we just

C++
please write me a code and make sure its variable and argument are easy to read becaue im new to this program. we just started the program. also we are only jn chapter 3 so please use variabels that i could understand
image text in transcribed
sample run
image text in transcribed
3. Write a program that implements a four-function (+,,/) calculator for fractions. The program should prompt for and read the first fraction, an arithmetic operator, and a second fraction, perform the required calculation, display the result, and then ask if the user wants to continue. The result should be displayed as a fraction - it does not need to be in reduced form. Program requirements: a) Write a program that does not make use of any floating point data nor variables. Read the numerator and denominator of each fraction into separate integer variables (using the same technique given in the first problem). Then produce the numerator and denominator of the resulting fraction sing basic fraction arithmetic. For example, a/b+c/d=(ad+bc)/bd. b) Make use of a swi.tch statement to organize the calculations associated with the different arithmetic operations. c) Use a do loop to control the calculator repetition. Here is an example of a user's interaction with the program: Enter first fraction: 1/2 Enter operation: + Enter second fraction: 1/3 Sum =5/6 Continue (y or n ) ? Y Enter first fraction: 1/2 Enter operation: - Enter second fraction: 1/3 Difference =1/6 continue (y or n ) ? y Enter first fraction: 1/2 Enter operation: / Enter second fraction: 1/3 Quotient =3/2 continue ( y or n )? n Process exited after 56.37 seconds with return value 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions