Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write an interactive menu-driven program that will perform various arithmetic calculations. A menu of different calculations will be shown to a user at the beginning

write an interactive menu-driven program that will perform various arithmetic calculations.

A menu of different calculations will be shown to a user at the beginning of the program (and again after each calculation). The user will select an option and the program will then prompt for additional information that is specific to the calculation, perform the actual calculation, and display the result. This process will continue until the user decides to quit.

The Arithmetic Calculations

The calculations that will be available to the user are:

  • finding the larger of two floating point numbers

  • determining if one integer number is divisible by another integer number

  • raising a real number (M) to an integer power (N) - M to the Nth power

  • calculating the factorial of an integer number. The factorial is the product of all integers from 1 to the integer. The exception is 0! which is equal to 1.

Sample Output:

Make a selection from the list below. L) Find the 'L'arger of 2 numbers D) Check if an integer is 'D'ivisible by another integer P) Find the value of the expression, M to the Nth 'P'ower F) Find the value of a 'F'actorial Q) 'Q'uit What would you like to do? L What is the 1st number? 11.8 What is the 2nd number? 30.1 The largest value is 30.1 Make a selection from the list below. L) Find the 'L'arger of 2 numbers D) Check if an integer is 'D'ivisible by another integer P) Find the value of the expression, M to the Nth 'P'ower F) Find the value of a 'F'actorial Q) 'Q'uit What would you like to do? m m is not a valid choice Make a selection from the list below. L) Find the 'L'arger of 2 numbers D) Check if an integer is 'D'ivisible by another integer P) Find the value of the expression, M to the Nth 'P'ower F) Find the value of a 'F'actorial Q) 'Q'uit What would you like to do? T T is not a valid choice Make a selection from the list below. L) Find the 'L'arger of 2 numbers D) Check if an integer is 'D'ivisible by another integer P) Find the value of the expression, M to the Nth 'P'ower F) Find the value of a 'F'actorial Q) 'Q'uit

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

Building The Data Warehouse

Authors: W. H. Inmon

4th Edition

0764599445, 978-0764599446

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago