I'm trying to create a claculator that asks: For each computation, before getting the numbers, ask the user if they want to perform:
• integer arithmetic (whole numbers input and whole number results); or
• floating point arithmetic (input numbers may contain a decimal, and output must contain a decimal).
and has the following menus:
CALCULATOR PRACTICE PROGRAM
Hello, and welcome to the Calculator Practice Program.
This program allows you to practice your math skills.
Choose what you want to practice in the menu shown below.
-----------------------------------------------
MAIN MENU
-----------------------------------------------
a. Addition (X+Y)
b. Subtraction (X-Y)
c. Multiplication (X*Y)
d. Division (X/Y)
e. Powers & Roots
q. Quit the program
-----------------------------------------------
Enter your choice [ a - e, q ]:
-----------------------------------------------
Powers & Roots Menu
Hello, and welcome to the Powers & Roots Menu.
This menu allows you to take powers and roots of a number.
---------------------------------------------------
POWERS & ROOTS MENU
---------------------------------------------------
a. Square a number (Xˆ2)
b. Cube a number (Xˆ3)
c. Raise to any power (XˆY)
d. Square root a number (Xˆ1/2)
e. Cube root a number (Xˆ1/3)
f. Take any root (Xˆ1/Y)
m. Return to Main Menu
q. Quit the program
---------------------------------------------------
Enter your choice [ a - f, m, q ]:
---------------------------------------------------
This is what i have so far ;
#include <cstdlib>
#include <iostream>
using namespace std;
int displayMenu()
{
int choice;
cout << " \n Hello, and welcome to the Calculator Practice Program.
This program allows you to practice your math skills.
Choose what you want to practice in the menu shown below.\n\n"