Help with Calculator

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"

<< " (a) Addition\n"
<< " (b) Subtraction\n"
<< " (c) Division\n"
<< " (d) Mulpilication\n"
<< " (e) Powers & Roots\n"
<< " (q) Exit\n\n"
<< " Enter Your Choice[a-e,q ]: ";
cin >> choice;
return choice;
}

int main(int argc, char *argv[])
{
int menu;
float total, num1, num2;

menu = displayMenu();
system("CLS");

if (menu == q)
{
cout << " Thank you for using the Calculator\n\n ";
cin.get();

}
else
{
switch (menu)
{
case a:
int values;
cout << " How many numbers would you like to enter? : ";
cin >> values;
float numbers[values];

for(int counter=0; counter<values; counter++)
{
cout << counter+1 << ") Enter number: ";
cin >> numbers[counter];
}
for(int counter=0; counter<values; counter++)
total+=numbers[counter];
cout << "\n The Answer is : " << total << "\n\n ";
system("PAUSE");
break;
case b: // Subtraction Completed
cout << " Enter first number: ";
cin >> num1;
cout << " Enter second number: ";
cin >> num2;
total=(num1-num2);
cout << "\n The Answer is : " << total << "\n\n ";
break;
case c: // Divison Completed
cout << " Enter first number: ";
cin >> num1;
cout << " Enter second number: ";
cin >> num2;
total=(num1/num2);
cout << "\n The Answer is : " << total << "\n\n ";
break;
case d: // Multiplication
cout << " Enter first number: ";
cin >> num1;
cout << " Enter second number: ";
cin >> num2;
total=(num1*num2);
cout << "\n The Answer is : " << total << "\n\n ";

}
system("PAUSE");
return EXIT_SUCCESS;
}

/*case 4: // Multiplication
for(int counter=1; counter<values; counter++)
total=(numbers[0]*numbers[counter]);
cout << "\n The Answer is : " << total << "\n\n "; */

system("PAUSE");
return EXIT_SUCCESS;
}
Topic archived. No new replies allowed.