So I have to create a program that follows these guidelines and i dont know where to start please help

Define a structure (struct) or class that can represent for a rational number.

Use the structure or class in a C++ program that can perform the following operations:

a. Adding two rational numbers. The result should be stored in reduced form.

b. Subtracting two rational numbers. The result should be stored in reduced form.

c. Multiplying two rational numbers. The result should be stored in reduced form.

d. Dividing two rational numbers. The result should be stored in reduced form.

e. Printing rational numbers in the form n/d, where n is the numerator and d is the denominator.

f. Printing Rational numbers in floating-point format.

Allow your program runs continuously until user wants to quit it.

Lastly, your name must be displayed (only) before the termination of the program.

Validate your input values; Reject all “junk” values. For floating-point values, limit 2 digits after the dot.

Define a structure (struct) or class that can represent for a rational number.

Use the structure or class in a C++ program that can perform the following operations:

a. Adding two rational numbers. The result should be stored in reduced form.

b. Subtracting two rational numbers. The result should be stored in reduced form.

c. Multiplying two rational numbers. The result should be stored in reduced form.

d. Dividing two rational numbers. The result should be stored in reduced form.

e. Printing rational numbers in the form n/d, where n is the numerator and d is the denominator.

f. Printing Rational numbers in floating-point format.

Allow your program runs continuously until user wants to quit it.

Lastly, your name must be displayed (only) before the termination of the program.

Validate your input values; Reject all “junk” values. For floating-point values, limit 2 digits after the dot.

Topic archived. No new replies allowed.