1. The program should call a function to display a menu of three options: a. 1-Integer Math b. 2-Double Math 3- Exit Program C. 2. The program must test that the user enters in a valid menu option. If they do not, the program must display an error message and allow the user to reenter the selection. Once valid, the function must retum the option selected. 3. If the user selects 1 or 2, the program should allow the user to enter in any two numbers. a. The program must create 5 functions called add, subtract, multiply, divide and mod. These functions must take two integers as arguments and retum an integer to the calling function. Each function performs the appropriate mathematical task. b. The program must create 4 functions called add, subtract, multiply and divide. These functions must take two doubles a pass by value parameters and one double as a pass by reference variables. The function does the calculation and sets the reference variable to the calculated value; this is how the value is returned to the calling function. Each function performs the appropriate mathematical task. c. The program must create two functions called display. i The first display function takes the five integer values calculated and displays them ii. The second display function takes the four double values calculated and display them to two decimal places

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
You are going to create a simple calculator.
1. The program should call a function to display a menu of three options:
a. 1-Integer Math
b. 2-Double Math
c. 3- Exit Program
2. The program must test that the user enters in a valid menu option. If they do not, the program must
display an error message and allow the user to reenter the selection. Once valid, the function must
retum the option selected.
3. If the user selects 1 or 2, the program should allow the user to enter in any two numbers.
a. The program must create 5 functions called add, subtract, multiply, divide and mod. These
functions must take two integers as arguments and retum an integer to the calling function.
Each function performs the appropriate mathematical task.
b. The program must create 4 functions called add, subtract, multiply and divide. These
functions must take two doubles as pass by value parameters and one double as a pass by
reference variables. The function does the calculation and scts the reference variable to the
calculated value; this is how the value is returned to the calling function. Each function
performs the appropriate mathematical task.
c. The program must create two functions called display.
i. The first display function takes the five integer values calculated and displays them
ii. The second display function takes the four double values calculated and display
them to two decimal places
Transcribed Image Text:You are going to create a simple calculator. 1. The program should call a function to display a menu of three options: a. 1-Integer Math b. 2-Double Math c. 3- Exit Program 2. The program must test that the user enters in a valid menu option. If they do not, the program must display an error message and allow the user to reenter the selection. Once valid, the function must retum the option selected. 3. If the user selects 1 or 2, the program should allow the user to enter in any two numbers. a. The program must create 5 functions called add, subtract, multiply, divide and mod. These functions must take two integers as arguments and retum an integer to the calling function. Each function performs the appropriate mathematical task. b. The program must create 4 functions called add, subtract, multiply and divide. These functions must take two doubles as pass by value parameters and one double as a pass by reference variables. The function does the calculation and scts the reference variable to the calculated value; this is how the value is returned to the calling function. Each function performs the appropriate mathematical task. c. The program must create two functions called display. i. The first display function takes the five integer values calculated and displays them ii. The second display function takes the four double values calculated and display them to two decimal places
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Types of Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education