Chapter 3: Problem 28
include
Chapter 3: Problem 28
include
All the tools & learning materials you need for study success - in one app.
Get started for freeAssume 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.
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.
Assume a string object has been defined as follows: string description; A) Write a cin statement that reads in a one word description. B) Write a statement that reads in a description that can contain multiple words separated by blanks.
Write \(C++\) expressions for the following algebraic expressions: A) \(a=12 x\) B) \(z=5 x+14 y+6 k\) C) \(y=x^{4}\) D) \(g=\frac{h+12}{4 k}\) E) \(c=\frac{a^{3}}{b^{2} k^{4}}\)
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
What do you think about this solution?
We value your feedback to improve our textbook solutions.