Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write C program Create a program that declares the following three integer variables: - opCode is an integer variable. - number_1 is an integer variable
Write C program Create a program that declares the following three integer variables: - opCode is an integer variable. - number_1 is an integer variable initialized to equal the LAST FOUR DIGITS of your STUDENT ID. - number_2 is an integer variable initialized to equal 19.
Variables. a program eger opCode is an integer variable. - number_1 is an integer variable initialized to equal the LAST FOUR DIGITS of your STUDENT ID. number_2 is an integer variable initialized to equal 19. Next prompt the user to enter a value for opCode (1, 2, 3, 4, or 5): Next, read the value entered from the keyboard and assign it to opCode: - Enter an integer value for opCode (1, 2, 3, 4, or 5): (Enter 1 from the keyboard for the first run) (Enter 2 from the keyboard for the second run) (Enter 3 from the keyboard for the third run) (Enter 4 from the keyboard for the fourth run) (Enter 5 from the keyboard for the fourth run) (Enter 9 from the keyboard for the fourth run) Next create a switch case statement that will display the following output: a. For opCode = 1, your code should display: The SUM of number_1 and number_2 = XXXXXXX b. For opCode = 2, your code should display: The DIFFERENCE of number_1 and number_2 = XXXXXXX c. For opCode = 3, your code should display: The PRODUCT of number_1 and number_2 = XXXXXXX d. For opCode = 4, your code should display: The QUOTIENT of number_1 and number_2 = XXXXXXX e. For opCode = 5, your code should display: The MODULUS of number_1 and number_2 = XXXXXXX f. For opCode = 9, your code should display: You have entered an INVALID value for opCode (USING FIELD WIDTH OF 7) (USING FIELD WIDTH OF 7) (USING FIELD WIDTH OF 7) (USING FIELD WIDTH OF 7) (USING FIELD WIDTH OF 7) The Name, Student ID and Section number that appears in the output of| the program should be your own, not the ones used in the sample run. Sample run 1: ************************************************************ Name: Smith, Peter Student ID: 300999999 Section: 001 ******** ***************************** 1 Enter an integer value for opCode (1, 2, 3, 4, or 5): The SUM of number_1 and number_2 = XXXXXXX Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started