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
You decide to configure ntp on the router to get time ntp server with an ip address of 172.17.8.254 which commanda should you us
Morgarella [4.7K]
Telenet into the router, authenticate and type enable once the prompt is back type ntp server 172.17.8.254 do this on all routers.
4 0
3 years ago
Some files appear dimmed in one of the default folders on your computer. What would be the best course of action? A. Leave the f
stira [4]
I believe it is B hope this helped you<span />
5 0
3 years ago
How to reinstall windows 7 on my pc,without format,because i don't want to loose my data,and can u give me a windows 7 setup ple
Tems11 [23]
You could install it from a flash drive a disk.
5 0
3 years ago
Hi I paid for brainy plus, but it says the it can't renew and try paying for it again but it won't work. Please help
Scorpion4ik [409]

Answer:

Contact CS, ( customer support ) They should be able to help you. Go to this link for more info. brainly.com/contact/index

Explanation:

8 0
3 years ago
Which line of code will only allow a symbol to be stored in a variable?
nataly862011 [7]
<h2>Answer:</h2><h2></h2><h2>phone = int(input("What is your phone number?"))</h2><h2></h2><h2>Hope this helps, have a great day, stay safe, and positive!!</h2>

8 0
2 years ago
Read 2 more answers
Other questions:
  • Which statements describe the advantages of using XML?
    12·2 answers
  • Implement a program to measure the impact of application-level buffer sizes on read time. This involves writing to and reading f
    13·1 answer
  • Write a C# solution for the following problem. Submit your .cs file to this link. Sample output(s) attached. == Create an Employ
    5·1 answer
  • Although some families have more resources than other families, there is always a limited amount of resources that families have
    15·2 answers
  • Part 1: For this assignment, call it assign0 Implement the following library and driver program under assign0: Your library will
    5·1 answer
  • Can someone please type a code that makes a house in python and turtle graphics i need help
    9·1 answer
  • Please help!!
    6·1 answer
  • What do hard disk drive use to store data
    10·1 answer
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
  • before you start researching fleet management software, your first task is to clearly define the problem. this will help guide y
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!