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]
2 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]2 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
HELP PLS QUICK TRUE OR FALSE QUESTION
dmitriy555 [2]

Answer: I think the answer is true but I don't fully understand it sorry if im wrong.

Explanation:

8 0
2 years ago
Read 2 more answers
A. A set of electronic program that makes of computer perform tasks
Nonamiya [84]

Answer:

2. Software

Explanation:

Software is an app

Hardware is the computer or cell phone or mobile phone

toppr

6 0
1 year ago
Write common ICT tools​
Naddika [18.5K]
  • computers
  • laptops
  • printers
  • scanners
  • software programs
  • data projectors
  • and interactive teaching box.

4 0
2 years ago
If you don’t have a paper copy of the FAFSA form, how else can you fill it out?
Ronch [10]
Go on your school computer, and find a copy of the form. Then print it from the school printer.
3 0
2 years ago
Read 2 more answers
Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex
poizon [28]

Answer:

answer:

#include <iostream>

#include<list>

using namespace std;

bool Greater(int x) { return x>3; } int main() { list<int>l; /*Declare the list of integers*/ l.push_back(5); l.push_back(6); /*Insert 5 and 6 at the end of list*/ l.push_front(1); l.push_front(2); /*Insert 1 and 2 in front of the list*/ list<int>::iterator it = l.begin(); advance(it, 2); l.insert(it, 4); /*Insert 4 at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl; l.erase(it); /*Delete the element 4 inserted at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl;

l.remove_if(Greater); for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " ";

/*Display the list*/

cout<<endl; return 0;

}

5 0
3 years ago
Read 2 more answers
Other questions:
  • While browsing through the mall, you are given samples of the latest perfumes from different designers. This is an example of wh
    14·1 answer
  • Which windows tool can you use to find out if the hard drive is slowing down windows performance?
    9·1 answer
  • Write a program in python that ask the user to enter a word and then capitalizes every other letter of that word
    15·1 answer
  • What's one way to engage teens in technology?
    8·1 answer
  • Explain three applications of data mining
    14·1 answer
  • Grace whistles while tickling Camille with a feather. Eventually, Camille starts to squirm and giggle every time Grace whistles,
    10·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an <br> ___?
    14·1 answer
  • Define the terms of data and information .​
    6·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
  • China's cultural diversity, China is composed of 56 ethnic groups.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!