Question: Write a C program to create a.out executable file. Your program should present a menu with 4 options, 1) Print author info 2) perform integer

Write a C program to create a.out executable file.

Your program should present a menu with 4 options,

1) Print author info

2) perform integer operation

3) perform floating point operation

0) Exit

Where selection 1 prints your information (name and student id)

selection two performs an integer math operation

selection 3 performs a floating point (non whole number) math operation.

Selection 0 will exit the program immediately.

Any other selection will print an error message stating that an invalid selection was made.

When one of the math operation selections are chosen, the user will enter a simple math formula (such as "1+1") you should then calculate the result of their entered formula and print both the operation and the result to the screen.

The result should be preceeded by the text "OUTPUT: "

The result should include two values to the right of the decimal.

for example if the user entered:

"4*6"

You would print:

OUTPUT: 4 * 6 = 24.00

You can expect the user to enter the formula in the format of:

op1op2 where there is no white space in the formula.

The operations you must support are:

+ addition

- subtraction

* multiplication

/ division

% modulus (integer operations only)

Make sure your results are mathematically correct (you will be graded on math as if this were a math class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!