Suppose you are given the following variable declarations: int x, y; double z; c
ID: 3627316 • Letter: S
Question
Suppose you are given the following variable declarations:int x, y;
double z;
char ch;
Assume you have the following input statement:
cin >> x >> y >> ch >> z;
What values (if any) are stored in x, y, z, and ch if the input is:
a. 35 62. 78
b. 86 32A 92.6
c. 12 .45A 32
4. Write a C++ statement that uses the manipulator 'setfill' to output a line containing 35 asterisk characters.
5. What is the output from the following statements?
a. if ( 60 <= 12 * 5)
cout << "Hello";
cout << " There";
b. if ('a' > 'b' || 66 > static_cast<int>('A'))
cout << "#*#" << endl;
c. if (7 <= 7)
cout << 6 - 9 * 2 / 6 << endl;
d. if (7 < 8)
{
cout << "2 4 6 8" << endl;
cout << "1 3 5 7" << endl;
}
e. if (5 < 3)
cout << "*";
else if (7 == 8)
cout << "&";
else
cout << "$";
Explanation / Answer
please rate - thanks
int x, y;
double z;
char ch;
Assume you have the following input statement:
cin >> x >> y >> ch >> z;
What values (if any) are stored in x, y, z, and ch if the input is:
a. 35 62. 78 x=35, y=62, ch=. , z=78
b. 86 32A 92.6 x=86, y=32,ch=A, z=92.6
c. 12 .45A 32 x=12 y=? A=? z=?
4. Write a C++ statement that uses the manipulator 'setfill' to output a line containing 35 asterisk characters.
cout<<setfill('*')<<setw(36)<<""<<endl;
5. What is the output from the following statements?
a. if ( 60 <= 12 * 5)
cout << "Hello";
cout << " There";
Hello There
b. if ('a' > 'b' || 66 > static_cast<int>('A'))
cout << "#*#" << endl;
#*#
c. if (7 <= 7)
cout << 6 - 9 * 2 / 6 << endl;
3
d. if (7 < 8)
{
cout << "2 4 6 8" << endl;
cout << "1 3 5 7" << endl;
}
2 4 6 8
1 3 5 7
e. if (5 < 3)
cout << "*";
else if (7 == 8)
cout << "&";
else
cout << "$";
$
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.