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

  Create the array to determine discount amount

Create the array (DISCOUNT-ARRAY) that will be used to determine discount company will give based on amount of an order.

  Explain the interaction framework

Explain the Interaction Framework discussed by Steven Heim (2008). Choose a computing device (like an ATM machine or the self-check-out at a grocery store

  Program for saving account balance report

Savings account balance report from customer savings account file. Every input savings account record contains account number, balance forward, deposits (sum of all deposits).

  Write functions to implement split-mergesort for files

Write functions to implement the split, merge, and mergesort algorithms for files. Also, write driver programs to test the given functions.

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

  Create visual basic windows application

Create Visual Basic Windows application. Use following names for solution and project, respectively: Raise Solution and Raise Project.

  Design logic for application for company-breakdown-payroll

Design the logic for an application for a company that wants a report containing a breakdown of payroll by department.

  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.

  Data members to store values of the two loans

A class that represents a person who belongs to a SACCO has two data members to store values of the two loans the person owes the SACCO. Add a parameterized constructor that initializes these loans using the two values passed as arguments.

  Scripting language programming in perl

course Scripting Language Programming,  Assignment   -  Perl,  ? Your coding style should conform to general Perl coding conventions. Your scripts should be clean, neat, and well-formatted (e.g. indention). Identifiers should also be properly name..

  Estimate the storage space for telephone book

Estimate the storage space (number of bytes) required for each of the following items: A telephone book with 10,000 entries consisting of names, addresses and phone numbers. Use your phone book to estimate the average length of an entry.

  Examine the boxplot

Examine the boxplot and briefly discuss the overall pattern of electricity usage for the households.

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