Chapter 3: Problem 14
Complete the following table by writing statements with combined assignment operators in the right-hand column. The statements should be equivalent to the statements in the left-hand column.
Chapter 3: Problem 14
Complete the following table by writing statements with combined assignment operators in the right-hand column. The statements should be equivalent to the statements in the left-hand column.
All the tools & learning materials you need for study success - in one app.
Get started for freedefine SIZE 12 How will the preprocessor rewrite the following lines? A) price \(=\operatorname{SIZE} … # Assume the following preprocessor directive appears in a program: # define SIZE 12 How will the preprocessor rewrite the following lines? A) price \)=\operatorname{SIZE} *\( unitcost B) cout \)<<\( setw \)(\operatorname{SIZE})<48.7\( C) cout \)<<\operatorname{SIZ} E$
inc…
#
Trace the following programs and tell what each will display. (Some require a
calculator.)
A) \(\text {(Assume the user enters } 38711 \text {. Use a calculator.})\)
# include { iostream }
using namespace std;
int main ( )
\\{
double salary, monthly;
cout \(<<\) "What is your annual salary? " \(\operatorname{cin}
\quad>>\operatorname{salar} y\)
month1y \(=\) static cast \(\langle\text { int }>(\text { salary ) } / 12\) cout
\(<<\) "Your monthly wages are " \(<<\) monthly \(<<\) end1 return 0
B) #include
Little Italy Pizza charges \(\$ 12.00\) for a 12 -inch diameter sausage pizza and \(\$ 14.00\) for a 14 -inch diameter sausage pizza. Write the pseudocode algorithm that calculates and displays how much each of these earns the establishment per square inch of pizza sold. (Hint: you will need to first calculate how many square inches there are in each pizza.)
Assume the following variables are defined: int age double pay: char section; Write a single cin statement that will read input into each of these variables.
A retail store grants its customers a maximum amount of credit. Each customer's available credit is his or her maximum amount of credit minus the amount of credit used. Write a pseudocode algorithm for a program that asks for a customer's maximum credit and amount of credit used, then calculates and displays the customer's available credit.
What do you think about this solution?
We value your feedback to improve our textbook solutions.