Question: 1. Write a C++ program that will find the average of 3 numbers entered by a user. Save the program as lab1. Compile and run

1. Write a C++ program that will find the average of 3 numbers entered by a user. Save the program as lab1. Compile and run the program. [5 pts]

2. Write a C++ program using the following variables: int numGiven, int numUsed, and float resultObtained. Divide the number given by the number used and display the result. Desk check using 500 as the number given, 26 as the number used and 19.2308 as the result obtained. Save the program as lab2. Compile and run the program. [10 pts]

3. Using the student data files open the SwatTheBugs17.cpp file. The program declares and initializes a double variable. It then adds 1.5 to the variable before displaying the variables value. Run and debug the program. [5 pts]

PART II Solve the following Arithmetic Expressions: [10 pts]

  1. 5 + 4 * 6 3 / 3 + 6 __________________________

  1. (4 + 5) * 6 - (3 / 3 + 6) __________________________

  1. 4 * 5 * (3 + 3) __________________________

  1. 6 2 / 2 + 2 * 2 3 __________________________

  1. 20 % 4 + 6 * 2 __________________________

PART III Solve the following Comparison Operations: [10 pts]

  1. 14 / 2 < 15 - 2 * 3 __________________________

  1. 6 * 2 + 3 > 5 * 4 __________________________

  1. 4 + 3 * 2 > 2 * 10 11 __________________________
  1. 8 + 3 - 6 + 85 < 5 * 26 __________________________
  2. 80 % 25 + 2 * 5 * 6 < 8 * 8 __________________________

PART III Solve the following Logical Operations: [10 pts]

  1. 30 > 75 / 3 && 5 < 10 * 2 __________________________

  1. 6 / 2 + 7 5 > 4 && 7 > 3 __________________________
  1. 8 < 12 / 2 || 4 > 9 % 3 * 4 __________________________
  1. 13 % 3 * 2 <= 1 && 9 \ 4 <= 2 __________________________
  1. 8 <= 4 + 6 && 5 > 6 || 4 < 7 __________________________

//SwatTheBugs17.cpp //Created/revised by on

#include using namespace std;

int main() { //declare variable double temp = 86.5; //increase variable's value by 1.5, and then display result temp =+ 1.5; cout << "After adding 1.5, the temp variable now contains " << temp << "." << endl;

return 0; } //end of main function

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!