Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please C++ programming 3. Write a program that implements a four-function (+,./ calculator for fractions. The program should prompt for and read the first fraction,

Please C++ programming 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 using basic fraction arithmetic. For example, a/b + c/d = (ad+bc)/bd. b) Make use of a switch 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)? n

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

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

=+. Show in Example 6.3 that P[IS, - L,| > L'/2+ 0.

Answered: 1 week ago

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago