1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vova2212 [387]
3 years ago
9

Consider the following program segment: //include statement(s) //using namespace statement int main() { //variable declaration /

/executable statements //return statement }
a) Write C11 statements that include the header files iostream and string.
b) Write a C11 statement that allows you to use cin, cout, and endl without the prefix std::.
c) Write C11 statements that declare the following variables: name of type string and studyHours of type double.
d) Write C11 statements that prompt and input a string into name and a double value into studyHours.
Computers and Technology
1 answer:
nordsb [41]3 years ago
4 0

Answer:

a. Write C++ statements that include the header files iostream and string.

#include <iostream>

#include <string>

b. Write a C++ statement that allows you to use cin, cout, and endl without the prefix std::.

To use cin and cout, one must first declare at least one variable. At this point, I'll assume that the variable has been declared already I'll name my variable "test" without the quotes.

cin>>test;

cout<<test<<endl;

c. Write C++ statements that declare the following variables: name of type string and studyHours of type double.

string name;

double studyHours;

d. Write C++ statements that prompt and input a string into name and a double value into studyHours.

string name;

double studyHours;

cout>>"What's your name?";

cin<<name;

cout<<"What's your study hours?";

cin>> studyHours;

PS: A full program in C++ that illustrates the above

#include <iostream>

#include <string>

using namespace std

int main()

{

string name;

double studyHours;

cout>>"What's your name?";

cin<<name;

cout<<"What's your study hours?";

cin>> studyHours;

cout<<"Hello "<<name<<", your study hour is "<<studyHours;

return 0;

}

You might be interested in
How to connect xbox one controller
erma4kov [3.2K]
Hey There! To connect an Xbox controller you click the Xbox logo on the middle of the controller, the button should turn white. Have A Brainly Day :)
3 0
3 years ago
Select the correct answer from each drop-down menu
Lana71 [14]

Answer:

The purpose of the domain name is for credibility and location purposes.

Explanation:

For example.

nz.gov means that the domain owner is the government on New Zealend

8 0
2 years ago
PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
AveGali [126]

Answer:

I think it the answer will be 0,1,2,3,4

Explanation:

7 0
3 years ago
Read 2 more answers
What shortcut keys do i use to print something on my keyboard ?
romanna [79]
CTRL+P. It's usually pressed when you want to print something.
5 0
3 years ago
Read 2 more answers
To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have
Norma-Jean [14]

Answer:

None of the mentioned options

Explanation:

  • If we define a method in a derived class with same declaration type as that of base class then it is said to be overriding a function which behaves differently which will depend on the object which is calling the method.
  • Option a,b and c are not any kind of methods we implement using coding.
  • Option d is done when number or data types of parameters are different than the declaration of the base type.

8 0
3 years ago
Other questions:
  • A(n ____________ is considered a named collection of bytes having persistent or lasting storage.
    10·1 answer
  • The CSS relative positioning property called ____ moves the element relative to its original position but preserves the space re
    9·1 answer
  • Net Worth is equal to assets minus liabilities. Which event will have the greatest impact (positive or negative) on one's net wo
    5·1 answer
  • Drag each storage device to its category.
    7·1 answer
  • There is a simple pattern for derermining if a binary number is odd. What is it and why does this pattern occur?
    8·1 answer
  • Write a Comparator that compares String objects by the number of words they contain. Consider any nonwhitespace string of charac
    15·1 answer
  • Which application is a digital version of a manual typewriter? A. Database B. Presentation C. Spreadsheet D. Word processor
    8·2 answers
  • The linear programming ingredient or blending problem model allows one to include not only the cost of the resource, but also th
    14·1 answer
  • Convert 198 / 61 to ratio​
    9·1 answer
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!