Write program to perform arithmetic operations on fractions

Assignment Help Programming Languages
Reference no: EM1363911

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0. Your program must be menu driven, allowing the user to select the operation (+, -, *, /) and input the numerator and denominator of each fraction. Your program must consist of at least the following functions:

a. Function menu: This function informs the user about the program's purpose, explains how to enter data, and allows the user to select the operation.
b. Function addFractions: This function adds two fractions together (or you can overload the +operator()).
c. Function subtractFractions: This function subtracts one fraction from another (or you can overload the -operator()).
d. Function multiplyFractions: This function multiplies two fractions together (or you can overload the *operator()).
e. Function divideFractions: This function divides one fraction into another (or you can overload the /operator()).

Some sample outputs are:
3 / 4 + 2 / 5 = 23 / 20
2 / 3 * 3 / 5 = 6 / 15

Your answers need not be in the lowest terms.

Reference no: EM1363911

Questions Cloud

Role of financial manager in maximizing shareholder value : Discuss the role of the financial manager in maximizing shareholder value within today's financial markets and what would be the manager's viewpoint vs. an employee or stockholder viewpoint regarding maximizing share value?
Explain what does it mean to be a dynamic manager : Dynamic Managers - How to we balance these to opposing facts, and what does it mean to be a dynamic manager?
Structural issues-differentiation and integration : Discuss the twin structural issues: differentiation and integration. Coordination must be achieved at both the micro- and the macro-levels. Discuss how this relates to the following:
Depreciation-impairments-depletion : You are an accounting tutor. One of your students is confused about impairment because the student has learned earlier that all assets are recorded at their historical cost. The student has the following list of questions for you:
Write program to perform arithmetic operations on fractions : Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0.
Determine annual effective rate earned on investments : A Corporation invests $1,000,000 at the beginning of the year. It adds another $250,000 at the end of 1st quarter, withdraws $350,000 at the end of second quarter,
Define the magnitude of the average force : find out the z-component of the block's momentum after the kick.
Design algorithm to produce list of customers : Design an algorithm to produce a list of customers from the Glad Rags Clothing Company's customer master file. Each record on the customer master file contains the customer's number.
Portfolio management presentation : What are the benefits of portfolio management and How is it being applied - how many organizations are applying the techniques successfully?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write program to list all english-math and science teachers

Suppose that input consists of a file of teachers. You are told to write a program to list all English, math, and science teachers. Each teacher can teach only one subject.

  Implementing class called card for standard playing card

Design and implement a aclass called Card that represents a standard playing card. each card has a suit and a face value.

  Write program for real estate agent

Write a program for a real estate agent. The program should perform the following tasks: ask users for the average house price for the each of past 5 years for a single family residence of 1500 square feet.

  Create application to generate a series of random numbers

Create the application to generate a series of 100 random numbers in the range of 1 through 1000. Save the series of numbers in a file.

  Top-down recursive descent parser

Write a hand-coded top-down recursive descent parser.

  Program to inputs four numbers and graphs them as pie chart

Write down a program which inputs four numbers and graphs them as pie chart.

  Program to calculate amount person would earn over a period

Write a program that calculates the amount a person would earn over a period of time if his or her salary is one penny the first day.

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Determining suitable parameters if pass-by-reference is used

Subprocedures in VBA utilize pass-by-reference. Which function or sub procedure alters its parameter?

  Applications in involve computing various powers of e

The transcendental number, e. Many applications in mathematics involve computing various powers of e. It can be proven that ex = 1 + x/1 + x2/2! + x3/3! + ... for all values of x. Of course, this is an infinite sum.

  Questions on programing problem with the process of analysis

Questions on Programing Problem with the process of analysis and reflection that went on as you developed the project.

  Issues into account for collecting user data via forms

In addition to making our forms easy to use we need to consider user privacy and the use of data. What are some of the issues which you believe you require to take into account for collecting user data via forms?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd