subject

Write a program that lets the user perform arithmetic
operations on fractions. fractions are of the form a/b, in which a and b are
integers and b 60. your program must be menu driven, allowing the user to
select the operation (+, -, *, or /) and input the numerator and denominator
of each fraction. furthermore, your program must consist of at least the
following functions:

a. function menu: this function informs the user about the programs
purpose, explains how to enter data, and allows the user to select the
operation.

b. function addfractions: this function takes as input four integers
representing the numerators and denominators of two fractions, adds the
fractions, and returns the numerator and denominator of the result.
(notice that this function has a total of six parameters.)

c. function subtractfractions: this function takes as input four
integers representing the numerators and denominators of two fractions,
subtracts the fractions, and returns the numerator and denominator of
the result. (notice that this function has a total of six parameters.)

d. function multiplyfractions: this function takes as input four
integers representing the numerators and denominators of two fractions,
multiplies the fractions, and returns the numerators and denominators of
the result. (notice that this function has a total of six parameters.)

e. function dividefractions: this function takes as input four integers
representing the numerators and denominators of two fractions, divides
the fractions, and returns the numerator and denominator of the result.
(notice that this function has a total of six parameters.)

some sample outputs are:

3 / 4 + 2 / 5 = 23 / 20
2 / 3 * 3 / 5 = 6 / 15

your answer need not be in the lowest terms.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Read this excerpt from helen keller’s autobiography, the story of my life. have you ever been at sea in a dense fog, when it seemed as if a tangible white darkness shut you in, and the great ship, tense and anxious, groped her way toward the shore with plummet and sounding-line, and you waited with beating heart for something to happen? i was like that ship before my education began, only i was without compass or sounding-line, and had no way of knowing how near the harbour was. "light! give me light! " was the wordless cry of my soul, and the light of love shone on me in that very hour. . the morning after my teacher came she led me into her room and gave me a doll. the little blind children at the perkins institution had sent it and laura bridgman had dressed it; but i did not know this until afterward. when i had played with it a little while, miss sullivan slowly spelled into my hand the word "d-o-l-l." i was at once interested in this finger play and tried to imitate it. when i finally succeeded in making the letters correctly i was flushed with childish pleasure and pride. running downstairs to my mother i held up my hand and made the letters for doll. i did not know that i was spelling a word or even that words existed; i was simply making my fingers go in monkey-like imitation. in the days that followed i learned to spell in this uncomprehending way a great many words, among them pin, hat, cup and a few verbs like sit, stand and walk. based on this excerpt, which words best describe helen keller?
Answers: 2
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
You know the right answer?
Write a program that lets the user perform arithmetic
operations on fractions. fractions are...
Questions
question
English, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20