Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  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

  1. 23 Lance Grant; _______ _______
  2. 23

Lance Grant _______ _______

  1. True or False
  1. To use the manipulators setprecision, setw, and setfill, the program must include the header file iostream.
  2. The manipulator setw formats the output of an expression in a specific number of columns; the default output is right-justified.
  3. cout is correct on c++ programming syntax.
  4. The function clear is used to skip certain input in a line.

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

#include

#include

using namespace std;

int main()

{

int x = 15; //Line 1

int y = 7634; //Line 2

cout

cout

cout

return 0;

}

Display:

  1. Consider the declaration:

char ch1, ch2;

and the input:

Hello there. My name is Micky.

  1. Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______

cin>>ch1;

cin.ignore(100, .);

cin>>ch2;

  1. Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______

cin>>ch1;

cin.ignore(10, *);

cin>>ch2;

  1. image text in transcribed
here a=1, b=2 and c=0.5. Input a, b, and - 5+1b2 - 4ac 5. Write a CH+ program that calculatex c; output a, b, c, and x, set precision as two decimals. ..20 For example C:\Users\zwu\Desktop oot\Release oot.exe Please input your a:1 Please input your b:2 Please input your c: 0.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

Students also viewed these Databases questions