Question: C++ language. Fill in the blanks Part A #include #include using namespace std; int main() { // initial variables for the sides float a =

C++ language. Fill in the blanks

Part A

#include

#include

using namespace std;

int main() {

// initial variables for the sides

float a = 0.f, b = 0.f, hyp = 0.f;

// TODO: prompt the user to input two sides

// TODO: read the input for `a` and `b`

// TODO: display the sides `a` and `b` back to the user

// TODO: calculate and store the hypotenuse

// TODO: display the value of `hyp`

// terminate

return 0;

}

Part B;

#include

using namespace std;

int main() {

// variable to hold the letter grade from the user

char grade = '\0';

// prompt and store the letter grade

cout << "What grade did you get in CS 1?" << endl;

cin >> grade;

// TODO: `if/else if` statements

// TODO: `switch` statement

// terminate

return 0;

}

Part C;

#include

#include

#include

using namespace std;

int main() {

// variables for the starting and stopping points

int x = 0, y = 0;

// prompt and store the values from the user

cout << "Enter the start and stop values for the loop: ";

cin >> x >> y;

// TODO: seed the random number generator using the current system time

// TODO: generate and display a random number between 1 and 5 (inclusive)

// TODO: `for` loop

// TODO: `while` loop

// TODO: `do-while` loop

// terminate

return 0;

}

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!