Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Below is 5 little problems that I am trying to do: 1. Write an if-statement that

ID: 3555954 • Letter: B

Question

Below is 5 little problems that I am trying to do:

1. Write an if-statement that does the following: if Age is 20 or above, Pass is 20; otherwise, Pass is 10. Both Age and Pass are already declared as integer variables.

Here is what I have:

if (Age >= 20)

cout << "Pass";

if (Age == 10)

cout << "Pass";

2. Complete the parameter of the following function, by adding a double variable b with the default value of 3.0.

double multiplyNumbers (int a,             )

3. Write a for-loop statement that displays numbers from 1 to 10 in each line. Use Counter as a counter variable.

4. Write a single-line C++ statement to declare an integer array arrName with size of 20 elements. 4.

5. Write a switch statement, if a char variable Age is

Explanation / Answer

1. Write an if-statement that does the following: if Age is 20 or above, Pass is 20; otherwise, Pass is 10.
Both Age and Pass are already declared as integer variables.

Here is what I have:

if (Age >= 20)
Pass = 20;
else
Pass = 10;

2. Complete the parameter of the following function, by adding a double variable b with the default value of 3.0.

double multiplyNumbers (int a,double b=3.0)

3. Write a for-loop statement that displays numbers from 1 to 10 in each line. Use Counter as a counter variable.

for(Counter = 1; Counter <= 10; Counter++)
cout << Counter << endl;

4. Write a single-line C++ statement to declare an integer array arrName with size of 20 elements. 4.

int arrName[20];

5. Write a switch statement, if a char variable Age is

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote