Sample Output

There are four samples below of input/output for A07.

Return to assignment description

First Sample -- no user errors

Line-Oriented Function Evaluator -------------------------------- Enter commands and I will evaluate them. Enter HELP or ? to get help. By Mark Young (A00000000) And ... ...press enter... >>> Help You may enter 'help' or '?' to get this help message. You may enter 'quit' to end the program. You may choose from any of the following functions: * add * multiply * factorial * maximum * minimum ...press enter... >>> Add 1 2 3 4 5 3 Answer: 18 ...press enter... >>> Multiply 1 2 3 4 5 3 Answer: 360 ...press enter... >>> Factorial 7 Answer: 5040 ...press enter... >>> Multiply 1 2 3 4 5 6 7 Answer: 5040 ...press enter... >>> Maximum 10 4 -9 77 6 -81 42 Answer: 77 ...press enter... >>> Minimum 10 4 -9 77 6 -81 42 Answer: -81 ...press enter... >>> add Answer: 0 ...press enter... >>> multiply Answer: 1 ...press enter... >>> maximum -100 Answer: -100 ...press enter... >>> minimum 1004 Answer: 1004 ...press enter... >>> QUIT

Second Sample -- unexpected commands

Line-Oriented Function Evaluator -------------------------------- Enter commands and I will evaluate them. Enter HELP or ? to get help. By Mark Young (A00000000) And ... ...press enter... >>> ? You may enter 'help' or '?' to get this help message. You may enter 'quit' to end the program. You may choose from any of the following functions: * add * multiply * factorial * maximum * minimum ...press enter... >>> sum 1 2 3 4 5 3 I'm afraid I don't recognize 'sum' ...press enter... >>> mutlipy 1 2 3 4 5 3 I'm afraid I don't recognize 'mutlipy' ...press enter... >>> quip I'm afraid I don't recognize 'quip' ...press enter... >>> exit I'm afraid I don't recognize 'exit' ...press enter... >>> quit

Third Sample -- argument errors

Line-Oriented Function Evaluator -------------------------------- Enter commands and I will evaluate them. Enter HELP or ? to get help. By Mark Young (A00000000) And ... ...press enter... >>> add 1 2 3.6 4 Only int arguments are allowed ...press enter... >>> multiply 1.0 2 3 4 Only int arguments are allowed ...press enter... >>> maximum 1 2 3.0 4 Only int arguments are allowed ...press enter... >>> minimum 1 2 3 nope Only int arguments are allowed ...press enter... >>> factorial You did not give enuf arguments ...press enter... >>> factorial 5 7 That's too many arguments ...press enter... >>> factorial -1 The function didn't like one of your numbers ...press enter... >>> Quit

Fourth Sample -- abbreviations

Line-Oriented Function Evaluator -------------------------------- Enter commands and I will evaluate them. Enter HELP or ? to get help. By Mark Young (A00000000) And ... ...press enter... >>> mul 2 4 -1 Answer: -8 ...press enter... >>> mult 4 8 Answer: 32 ...press enter... >>> multi 4 8 Answer: 32 ...press enter... >>> multip 4 8 Answer: 32 ...press enter... >>> multipl 4 8 Answer: 32 ...press enter... >>> multiply 4 8 Answer: 32 ...press enter... >>> multiplys 4 8 I'm afraid I don't recognize 'multiplys' ...press enter... >>> max 4 8 Answer: 8 ...press enter... >>> maxim 4 8 Answer: 8 ...press enter... >>> min 4 8 Answer: 4 ...press enter... >>> mu 4 8 I'm afraid I don't recognize 'mu' ...press enter... >>> mi 4 8 I'm afraid I don't recognize 'mi' ...press enter... >>> ma 4 8 I'm afraid I don't recognize 'ma' ...press enter... >>> maxm 7 6 9 5 I'm afraid I don't recognize 'maxm' ...press enter... >>> quit

Return to assignment description