Computers and Technology
Computers and Technology, 30.05.2020 19:02, gray69

Rational fractions are of the form a/b, in which a and b are integers and b≠0. In this exercise, by "fractions" we mean rational fractions. Suppose a/b and c/d are fractions. Arithmetic operations on fractions are defined by the following rules: ‍ ‍ ‍ Fractions are compared as follows: a/b op c/d if ad op bc, in which op is any of the relational operations. For example, a/b < c/d if ad > bc. Design a class—say, fractionType—that performs the arithmetic and relational operations on fractions. Overload the arithmetic and relational operators so that the appropriate symbols can be used to perform the operation. Also, overload the stream insertion and stream extraction operators for easy input and output. Write a C++ program that, using the class fractionType, performs operations on fractions. Among other things, test the following: Suppose x, y, and z are objects of type fractionType. If the input is 2/3, the statement should store 2/3 in x. The statement should output the value of x + y in fraction form. The statement should store the sum of x and y in z in fraction form. Your answer need not be in the lowest terms.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:10, tmmackie9261
What is word processing and word wrap?
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, dondre54
in 2007, floridians died in alcohol-related collisions.a.  501b.  1,051c.  5,015d.  10,839
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, MagicDragon4734
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
image
Computers and Technology, 23.06.2019 21:00, kkpsmith
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
Do you know the correct answer?
Rational fractions are of the form a/b, in which a and b are integers and b≠0. In this exercise, by...

Questions in other subjects:

Konu
Arts, 04.05.2021 18:20