Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//in c++ /* The purpose of this lab is to utilize 'goto' statement by creating a menu 1. Ask the users for 2 integer values

//in c++

/* The purpose of this lab is to utilize 'goto' statement by creating a menu 1. Ask the users for 2 integer values 2. Define a label 'choice' , prompt the user with 3 choices ( add , subtract, multiply) 3. Use 'if else if..else' statements to navigate the choices, if choice 1 is selected, then go to label add and do the proper action, output the result and come back to the label choice , use 'goto' choice, do the same for sub,mult. 4. Define labels ( choice , add , subt, mul , end) */ #include #include using namespace std; int main(int argc, char** argv) {

// Declare two integers // Prompt the user to enter two values // Scan the two values to the declared integers // Defining a choice label choice: cout<<"Select a choice: " "1 for addition " "2 for subtraction " "3 for multiplication " "any other number to quit"<

mult: // Output the multiplication of the two variables // Go to the label choice to prompt the user to select a choice End: return 0; }

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

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions