Question: What is a loop for? Makes the code for you It helps repeat a sequence of instructions until a specific condition is met (We can

  1. What is a loop for?
  2. Makes the code for you
  3. It helps repeat a sequence of instructions until a specific condition is met (We can cycle through values, add sums of numbers, repeat functions, and many other things.)
  4. Dictates the steps that you need to take for a completion of the code
  5. Blocks a code before it corrupts
  6. What is the difference between a variable and a constant?
  7. Why do we use "void" in a function?
  8. Void functions are created and used just like value-returning functions except they do not return a value after the function executes.
  9. To ignore any variables sent the function
  10. Makes the code longer
  11. To return a void variable to the place a function was called

  1. What is "cin" used for?
  2. To read input from an input stream (such as user input information)
  3. To Output data to assist with the program
  4. It's a timer used in programing
  5. It's a typo and has no meaning

  1. What is "cout" used for?
  2. It is an output stream that is used to show output
  3. It's an input stream that is used to display a input
  4. It is used to terminate the program
  5. It's a counter used in programs.

  1. What is the purpose of "endl"?
  2. It is used to insert a new line character and flush the stream in the program.
  3. It is used at the beginning to allow the user to input data
  4. It is used as a counter in the programming
  5. It's an acronym for "Engage natural download" and allows the user to save program.

For 7-9, Write the appropriate letter from the definitions below next to the term:

  1. Functions
  2. Operators
  3. Parameters

  1. Special symbols that are used to represent and direct simple computations (many are used to perform math or comparisons).
  2. A method that carries out tasks defined by a sequence of statements
  3. variable which takes on the meaning of a corresponding argument passed in a call to a function

For 10-15, Select best choice (bold or underline) or give a short answer

  1. What is a comment and how do you insert one in a C program?

  1. Which are the arithmetic operators:
  2. Operators using: >, <, >=, <=, ==, !=
  3. Operators using:&&, ||, !
  4. Operators using: +, -, *, /, %
  5. When using an if-else statement the else part only happens if the if statement is:
  6. True
  7. False
  8. Inconclusive
  9. Which is the shortest possible operator to increment an integer variable's value by 1?
  10. ++
  11. +1
  12. 1+

  1. Use this to specify a block of code to perform if a condition is true.
  2. else
  3. cout
  4. if
  5. cin

  1. What does a breakpoint in an IDE allow us to do while debugging?
  2. Stop code execution at a certain point in order to examine variable values
  3. Comment portions of code
  4. Temporarily skip a section of code
  5. Executes the code after the breakpoint only

For 16-18, Review the code and answer the questions

  1. What does this code do (either give a specific example or generally what does this code do)?

#include

using namespace std;

int main() {

int r, h;

float vol;

cout<<< "Enter radius";

cin>>r;

cout<< "Enter height";

cin>> h;

vol=(3.14*r*r*h);

cout<<"The volume is: "<

return 0;

}

  1. If you ran this program what would it output?

#include

using namespace std;

int main() {

int first, second;

first=10;

second=5;

while (first>second){

cout<< first << " ";

first--;

}

cout<< "The end!";

}

  1. What would the following code output with the inputs: %, 4, 5?

#include

using namespace std;

// Main program

int main()

{

char op;

float num1, num2;

//It allows user to enter operator i.e. +, -, *, /

cin >> op;

// It allow user to enter the operands

cin >> num1;

cin >> num2;

// Switch statement begins

switch (op) {

// If user enter +

case '+':

cout << num1 + num2;

break;

// If user enter -

case '-':

cout << num1 - num2;

break;

// If user enter *

case '*':

cout << num1 * num2;

break;

// If user enter /

case '/':

cout << num1 / num2;

break;

// If the operator is other than +, -, * or /,

// error message will display

default:

cout << "Error! operator is not correct";

break;

} // switch statement ends

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 Programming Questions!