Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

To get full credit you need to follow the output rules exactly. the file check.sh can be used to check some basic operations for your program. Run it from the command prompt using the following syntax ./check.sh _path_to_executable

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

What is the Dividend yield currently of Apple Inc?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago