Be sure you have read chapter 10.
Do the following programming problems. You will end up with at least one code file per problem. Submit your program source (and any other needed files) by sending mail to bmassing@cs.trinity.edu, with each file as an attachment. Please use a subject line that mentions the course and the assignment (e.g., ``csci 1320 homework 7'' or ``CS1 hw7''). You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Linux machines, so you should probably make sure they work in that environment before turning them in.
The program should prompt for numerators and denominators for
two rational numbers and print the result of calling the four
arithmetic-operation functions and any optional functions.
(It should just print an error message if either denominator
is zero.)
Sample output for inputs 1, 2, 6, and 10:
r1 = 1/2 r2 = 6/10 r1 in lowest terms = 1/2 r2 in lowest terms = 3/5 r1 + r2 (lowest terms) 11/10 r1 - r2 (lowest terms) -1/10 r1 * r2 (lowest terms) 3/10 r1 / r2 (lowest terms) 5/6 r1 < r2
Notes/hints:
For non-negative integers and , not both zero, with ,