HW1 - / Homework #1 p.37 #13 Przybylski...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
// Homework #1 p.37 #13 Calculator Scott Przybylski P #include<iostream> using namespace std; #include<stdio.h> #include<stdlib.h> int menu(); int add(); int subtract(); int multiply(); int divide(); int again(); i int main() { system("clear"); int *choice = new int; int *choicenum = new int; char *yesno = new char; mainmenu: *choice = menu(); while(*choice < 1 || *choice > 5) { //system("clear"); *choice = menu(); } switch(*choice) { case 1: *choicenum = add(); askagain1: *yesno = again(); if(*yesno == 'y' || *yesno == 'Y') { //system("clear"); goto mainmenu; } if(*yesno == 'n' || *yesno == 'N') { *choicenum = 5; break; } else { goto askagain1; } case 2: *choicenum = subtract(); askagain2: *yesno = again(); if(*yesno == 'y' || *yesno == 'Y') { //system("clear"); goto mainmenu; } if(*yesno == 'n' || *yesno == 'N') { *choicenum = 5; break; }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
else { goto askagain2; } case 3: *choicenum = multiply(); askagain3: *yesno = again(); if(*yesno == 'y' || *yesno == 'Y') { //system("clear"); goto mainmenu;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

HW1 - / Homework #1 p.37 #13 Przybylski...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online