UMBC CMSC 104 | CSEE | 104 | current 104 |
Programming Project 3
Math Helper v0.1
1 2 3 ------------ 1 | 1 2 3 2 | 2 4 6 3 | 3 6 9Your table should be formatted nicely and contain the appropriate number of dashes to make up the table heading. You should also print the numbers as the column headings and at the beginning of each row. Hint: See if you can just get the basic table printed initially without the headings and numbers for the rows. Once you have that working, then work on the formatting.
linux3[92]% gcc -ansi -Wall proj3.c linux3[93]% ls a.out proj3.c linux3[94]% a.out Welcome to Math Helper v0.1! Your greeting goes here. It should contain a very detailed explantion of the program. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: M Enter the maximum multiplier/multiplicand you would like to see in the multiplication table: 8 Multiplication Table with a maximum multiplier/multiplicand of 8: 1 2 3 4 5 6 7 8 -------------------------------- 1 | 1 2 3 4 5 6 7 8 2 | 2 4 6 8 10 12 14 16 3 | 3 6 9 12 15 18 21 24 4 | 4 8 12 16 20 24 28 32 5 | 5 10 15 20 25 30 35 40 6 | 6 12 18 24 30 36 42 48 7 | 7 14 21 28 35 42 49 56 8 | 8 16 24 32 40 48 56 64 M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: m Enter the maximum multiplier/multiplicand you would like to see in the multiplication table: 4 Multiplication Table with a maximum multiplier/multiplicand of 4: 1 2 3 4 ---------------- 1 | 1 2 3 4 2 | 2 4 6 8 3 | 3 6 9 12 4 | 4 8 12 16 M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: G Enter the first integer: 35 Enter the second integer: 20 The greatest common divisor of 35 and 20 is 5. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: G Enter the first integer: 31 Enter the second integer: 19 The greatest common divisor of 31 and 19 is 1. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: r Enter the base number: 4 Enter the power: 2 4 raised to the power 2 is 16. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: R Enter the base number: 5 Enter the power: 3 5 raised to the power 3 is 125. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: T T is not a valid menu choice. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: y Y is not a valid menu choice. M - Print a Multiplication Table G - Find the Greatest Common Divisor R - Raise a Number to a Power Q - Quit Enter your menu selection: Q Thank you for using Math Helper v0.1. linux3[95]%
Here is a sample submission command. Note that the project name starts with uppercase 'P'.
submit cs104_0401 Proj3 proj3.c
To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show the file that you submitted in a format similar to the Unix 'ls' command.
submitls cs104_0401 Proj3