Write program for user to perform arithmetic operations

Assignment Help Programming Languages
Reference no: EM1366624

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: EM1366624

Questions Cloud

Calculate the amount of the equal periodic payments : Following are the present value factors for $1 discounted as 8 percent for 1 to 5 periods. Each of the following items is based on 8 percent interest compounded yearly from day of deposit to day of withdrawal.
Federal patient protection : How might the new federal Patient Protection and Affordable Care Act of 2010 affect the revenue of the health care industry?
How software architecture department can support production : Explain how Software Architecture Department can support production, inventory, sales, and marketing to assure Zilack can meet its business objectives.
Compute the required annual investment : A businesswoman wishes to invest a certain sum of money at the end of every year for five years. The investment will receive 6 percent compounded yearly.
Write program for user to perform arithmetic operations : 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.
Standard deviation of return : The expected returns earned from investment in the stock of two companies, Company A and Company B, are shown in the following table. Use the table to complete parts (a) through (e) below.
Determine the effective interest rate on the bonds : Shaid company issued $2,000,000 of 6 percent, ten year convertible bonds on June 1st, 1993 at 98 plus accrued interest. The bonds were dated April 1st, 1993, with interest payable April 1st and October 1se. Bond discount is amortized semiannually on ..
Create an algorithm to produce list of customers : Create an algorithm to produce list of customers from Glad Rags Clothing Company's customer master file. Each record on customer master file contains the customer's number
Disease-oriented health care system : Describe the role of health care reform in shifting the focus from a disease-oriented health care system toward one of wellness and prevention, and how does nursing fit to this shift?

Reviews

Write a Review

Programming Languages Questions & Answers

  Explain the use of xml dom

When the XMLHttpRequest object receives XML data, it parses and stores the data as an XML DOM object in the responseXML property. Why does the XML DOM used in the above example?

  Explaining graphics as user experience on web sites

Graphics provide significant richness to the user experience on web sites. Discuss how each of these sites uses graphics in good or poor ways.

  Program to generate a random number between a range

Write down a program to generate random number between 1 and 100 and asks user to guess what number is.

  List various bindings to determine the semantics

List the various bindings that are required to determine the semantics when the statement is executed. For each binding, indicate the binding time used for the language.

  What are the contents of given register

Memory location 2000H has the word 5000H stored in it. What does each location contain after INC BYTE PTR[2000H]. Also after DEC WORD PTR[2000H]

  Top-down recursive descent parser

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

  Creating table-find employee attended meeting on given date

The rows of this table record the fact that an employee from a particular project attended a meeting on the given date.

  Program to write variable declarations and function calls

Write a program whose main function is merely a collection of variable declarations and function calls. This program reads a text and outputs the letters, together with their counts.

  Iimplement a class called monetarycoin

Create an implement a class called MonetaryCoin that is derived from the class Coin class. Store a value in the in the monetary coin that represents its value.

  Solve the programming problem

Solve the programming problem

  Does loop have dependences two-dimensional arrays

Consider the following code with two-dimensional arrays. Does this loop have dependences? Can these loops be written so they are parallel?

  Design and write payroll program-employee-s hourly pay rate

Design and write a payroll program that will prompt the user to enter an employee's hourly pay rate and the number of hours worked.

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