Question: pls give the code PROBLEM: Create a program, that follows all Conestoga IT Programming standard, marks will be deducted per error. This program will allow


PROBLEM: Create a program, that follows all Conestoga IT Programming standard, marks will be deducted per error. This program will allow a user to enter either 2 or 3 values in a range, and then pick a math operation to complete with those values. The basic operation is as follows: Step 1: Ask the user for their name. Step 2: Ask the user if they want to enter 2 or 3 numbers. Step 3: Request each number value (between 500 and 500 ). If not within the range, Display error message and repeat. Step 4: Select a math operation, perform it, and then display the results. Step 5: End the program or repeat. CODING REQUIREMENTS: Methods: - The math operations are to be created inside separate methods. - Each method accepts double parameters and returns a double result. - There will be at least four methods in total.as follows: 2 methods to Add the parameters, (either 2 or 3 parameters). 2 methods to Subtract the parameters, (either 2 or 3 parameters). Program Logic: - Accept the user's first and last name and store them in two SEPARATE variables. Ask the user if they want to enter 2 or 3 values for their calculations. If the entered value is not a 2 or 3 an error message is displayed, and the user is prompted to try again. See sample output for example. - Accept each of the requested number of values in the range of 500 to 500 . If an entered value is not within the range an error message is displayed, and the user is prompted to try again. See sample output for example. - The program presents the user with the following options: 1. Add 2. Subtract - Create a switch block to determine which operation to do based on user input. - Within the switch block each case statements should perform as follows: Check to see if 2 or 3 values were entered to be part of the calculation. Call the correct method to perform the operation, sending the appropriate number of parameter values to it, and receive the result. Display the user's name along with the answer based on the output examples below. The results should be displayed to 2 decimal places. If an invalid choice was entered display an error message. - After the output of the calculation is displayed, ask the user if they would like to END or repeat. If they enter END the program will terminate. Note that the program will have to run one time. Based on this you must use a do-while to satisfy this requirement. SAMPLE OUTPUT 1: (Single run, 2 values, no errors): Please enter your first name: Bill Please enter your last name: Smith Please enter number of values to accept: 2 Enter number 1 (between 500 and 500): 35 Enter number 2 (between 500 and 500): 5 1. Addition 2. Subtraction Select an option: 1 Bill Smith: 35+5=40.00 Enter END to exit or anything else to continue. SAMPLE OUTPUT 2: (Single run with two out-of-range entries): Please enter your first name: Bill Please enter your last name: Smith Please enter number of values to accept: 4 Error: Value out of range. Enter 2 or 3. Please enter number of values to accept: 3 Enter number 1 (between 500 and 500 ): 100 Enter number 2 (between 500 and 500): 2500 Error: Entered value must be between 500 and 500 Enter number 2 (between 500 and 500): 200 Enter number 3 (between 500 and 500 ): 300 1. Addition 2. Subtraction Select an option: 2 Bill Smith: 100200300=400.00 Enter END to exit or anything else to continue. Submission: 1. Be sure to save all changes. 2. Make sure in the program header, comment your name and student id. 3. View your output, then make changes, and review as needed. 4. When satisfied with your exercise, submit a compressed .zip format (no .rar or other formats accepted) containing the entire project folder and upload the contents to the eConestoga Portal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
