Chapter 2: Problem 7
Give good variable names for each of the following: a. A variable to hold the speed of an automobile b. A variable to hold the pay rate for an hourly employee c. A variable to hold the highest score in an exam
Chapter 2: Problem 7
Give good variable names for each of the following: a. A variable to hold the speed of an automobile b. A variable to hold the pay rate for an hourly employee c. A variable to hold the highest score in an exam
All the tools & learning materials you need for study success - in one app.
Get started for freeWrite a complete \(C++\) program that asks the user for a number of gallons and then outputs the equivalent number of liters. There are 3.78533 liters in a gallon. Use a declared constant. since this is just an exercise, you need not have any comments in your program.
Give a \(\mathrm{C}++\) statement that will change the value of the variable sum to the sum of the values in the variables \(n 1\) and \(n 2\). The variables are all of type int.
What is the output of the following program lines (when embedded in a correct program that declares number to be of type \(i n t\) )? number \(=(1 / 3) * 3\) cout \(<<"(1 / 3) * 3\) is equal to \("<<\) number
Give the declaration for two variables called feet and inches. Both variables are of type int and both are to be initialized to zero in the declaration. Use both initialization alternatives.
Write an \(i f\) -else statement that outputs the word Warning provided that either the value of the variable temperature is greater than or equal to \(10 \theta,\) or the value of the variable pressure is greater than or equal to 200 or both. Otherwise, the \(i f\) -else statement outputs the word OK. The variables temperature and pressure are both of type int.
What do you think about this solution?
We value your feedback to improve our textbook solutions.