Comp 121

Chapter 3 Study Guide

Chapter 3

What is the general form of the assignment statement?

 

In the statement total_weight = factor * weight; what is the first part to be evalutated?

 

Why is the line amount + 1892 = 1000 + 10 * 5; an invalid statement?

 

What is the assignment operator and what is its precedence?

 

Is a = b = c = 25; a valid expression?

 

What happens if the variable temp is an integer variable and the assignment temp = 25.89; is made?

 

What is the shortcut assignment operator /= equivalent to?

 

What does the operator ++ do when it appears before a variable (such as ++temp)? What does it do when it appears after a variable (such as temp++)?

 

What does the mathematical function abs(a) do? What is the mathematical function for calculating a square root? What is the mathematical function for calculating a sine value and how do you use it (what do you pass it and what does it return)?

 

What does the line #include <math.h> do in a program?

 

What is the general form to pass data to a function?

 

What is a cast operator? How is it used?

 

What is the cin object used for? What will the line cin >> num1 do if num1 is a float? Is cin >> ch1 >> ch2 >> ch3; a valid statement?

 

What does the const qualifier do?