Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1. What will be displayed on the screen from the following statements? #include #include usingnamespacestd; intmain() { intx = 15;//Line 1 inty = 7634;//Line 2 cout //Line 3 cout "...

1 answer below »

1.What will be displayed on the screen from the following statements?

#include

#include

usingnamespacestd;

intmain()

{

intx = 15;//Line 1

inty = 7634;//Line 2

cout //Line 3

cout " XXXXXXXXXX"//Line 4

cout '@')

'#')

'^') "Warm"

//Line 5

return0;

}

Display:

2.Consider the declaration:

char ch1, ch2;

and the input:

Hello there. My name is Micky.

a)Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______

cin>>ch1;

cin.ignore(100, ‘.’);

cin>>ch2;

b)Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______

cin>>ch1;

cin.ignore(10, ‘*’);

cin>>ch2;

3.Write a C++ program that calculate, here a=1, b=2 and c=0.5. Input a, b , and c; output a, b, c, and x, set precision as two decimals.

1.Suppose thatageis anintvariable,chis acharvariable, andnameis astringvariable. What are the values ofageandnameafter the following input statements execute:

cin>>age;

cin.get(ch);

getline(cin, name);

if the input is:

agename

a.23 Lance Grant;______________

b.23

Lance Grant______________

2.True or False

a.To use the manipulatorssetprecision, setw, andsetfill, the program must include the header fileiostream.

b.The manipulatorsetwformats the output of an expression in a specific number of columns; the default output is right-justified.

c.coutis correct on c++ programming syntax.

d.The functionclearis used to skip certain input in a line.

Answered Same Day Mar 15, 2021

Solution

Neha answered on Mar 16 2021
166 Votes
Name: ________________
Close book, close note. You have questions on both sides. Please turn in the paper, also submit you programming in blackboard in “Assignments-Quiz4”.
1. Suppose that age is an int variable, ch is a char variable, and name is a string variable. What are the values of age and name after the following input statements execute:
cin
age;
cin.get(ch);
getline(cin, name);
if the input is:
age name
a. 23 Lance Grant; _23___ ___ance Grant___
. 23
Lance Grant __23___ __Lance Grant__
2. True or False
a. To use the manipulators setprecision, setw, and setfill, the program must include the header file iostream. False
. The manipulator setw formats the output of an expression in a specific number of columns; the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here