Question: This is all together C++ please Lab 1 Enter and run the following program: int num1; int num2 = 5; cout < < Please enter

This is all together C++ please
Lab 1 Enter and run the following program: int num1; int num2 = 5; cout << "Please enter an integer: "; cin >> num1; cout << "num1 = " << num1 << " and num2 = " << num2 << endl; if (num1 = num2) { cout << "Hey, that's a coincidence!" << endl; } if (num1 != num2) { cout << "The values are not the same." << endl; } Exercise 1. Run the program several times using a different input each time. Does the program do what you expect? If so, explain what it is doing. If not, locate the error and fix it. Exercise 2. Modify the program so that the user inputs both values to be tested for equality. Make sure you have a prompt for both inputs. Test the program with pairs of values that are the same and different. Exercise 3. Modify the program so that when the numbers are the same it prints the following lines: The values are the same. Hey that's a coincidence. Exercise 4. Modify the revised Exercise 3 program by replacing the two if statements with a single if/else statement. Run the program again to test the results. Lab 2 Enter the following program: double average; cout << "Input your average: "; cin >> average; if (average > 60) { cout << "You pass" << endl; } if (average < 60) { cout << "You fail" << endl; } return 0; Exercise 1. Run the program three times using 80, 55, and 60 for the average. What happens when you input 60 for the average? Modify the first if statement so that the program will print "You pass" if the average is 60. Exercise 2. Modify the program so that it uses an if/else statement rather than two if statements. Exercise 3. Modify the program from Exercise 2 to allow the following categories: Invalid data (average above 100), 'A' category (90-100), 'B' category (80-89), "You pass" category (60-79), and "You fail" category (0-59). What will happen to your program if you enter a negative value such as -12? Lab 3 Write a program that has the user enter their gpa and the year of school they are in (1-freshman, 2-sophomore, 3-junior, 4-senior). If the user's gpa is 2.0 or above, and they are in the 4th year, the program should display, "You are about to graduate soon." If the user enters a gpa less than 2.0 or a year less than 4, the program should display "You need more schooling." Lab 4 A t-shirt shop sells shirts that retail for $10.00. Quantity discounts are given as shown below: 5-10 shirts: 10% discount 11-20 shirts: 15% discount 21-30 shirts: 20% discount 31 or more: 25% discount Write a program that prompts the user to enter the number of shirts required and then computes the total price. Make sure the program only accepts non-negative input.  

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!