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
there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create
Sever21 [200]

Answer:

The program in C is as follows:

#include<stdio.h>

#include<conio.h>

struct employee{

char empname[50]; int empcode, day,mon,yr;

}employees[30];

int main(){

int total;

printf("Numbers of Employees : "); scanf("%d",&total);

for(int kt=0;kt<total;kt++){

printf("Employee Code : "); scanf("%d",&employees[kt].empcode);

printf("Name: "); scanf("%s",employees[kt].empname);

printf("Date of Joining [dd mm yyyy]: "); scanf("%d%d%d",&employees[kt].day,&employees[kt].mon,&employees[kt].yr); }

int year;

printf("\nCurrent Date [Year only]: "); scanf("%d", &year);

printf("Code\t\t\t Name\t\t\t Date of Joining\n");

for(int kt=0;kt<total;kt++)

if((year - employees[kt].yr) >= 15)

printf("%d\t\t\t %s\t\t\t %d/%d/%d\n",employees[kt].empcode,employees[kt].empname, employees[kt].day,employees[kt].mon,employees[kt].yr);

}

Explanation:

See attachment for explanation where comments were used to explain some lines

Download txt
3 0
3 years ago
Express 0.0005 x 10-4 farads as picofarads
prohojiy [21]
0.0005 x 10⁻⁴ Farad = 0.000 000 05 Farad.
1 pF = 0.000 000 000 001 Farad

Divide them and get 50000 pF.
3 0
3 years ago
Read 2 more answers
Which describes the "Network Effect?"
Lorico [155]

The statement which best describes the network effect is a platform becomes more useful as more people join and use it.

<h3>What is "Network Effect?"</h3>

Network effect is the theory which tells that when the number of person increases in a network, then the value of the product or service in that network is also increases.

Key points of network effect are listed below:

  • In the network effect the value of product or service of a network increases when the more people join and use it.
  • Network effect is well utilized by e-commerce companies by promoting their business through the customers.
  • The best example of network effect sides are social media sites.

Thus, the statement which best describes the network effect is a platform becomes more useful as more people join and use it.

Learn more about the network effect here;

brainly.com/question/26199042

#SPJ1

4 0
2 years ago
Add a function named circle to the polygons module. This function expects the same arguments as the square and hexagon functions
PolarNik [594]

Answer and Explanation:

import Circle

#include<conio.h>

void main ()

int t , length , n

//for hexagon

def hexagon(t, length, n):

 for _ in range(n):

 t.fd(length)

t.lt(360 / n)

square = Circle.Circle()

square.penup()

square.sety(-270)

square.pendown()

hexagon(square, 30, 60)

5 0
3 years ago
Explain what LIFO and FIFO mean, and how they are used in Abstract data types?
Dimas [21]

Answer:

LIFO stands for Last In First Out. This procedure is used in the Stacks in data structures.Stacks are the data types in which the data is stored called Stack.

Explanation:

8 0
3 years ago
Other questions:
  • Melissa is visiting a Web page that her co-workers frequently update throughout the day. If she wants o make sure she has the mo
    11·1 answer
  • Torque is defined as _____.
    7·1 answer
  • Write a program that read first a user's given name followed by the user's age from standard input. Then use an ofstream object
    8·1 answer
  • When did project management first emerge as a profession
    6·1 answer
  • IF YOU ARE COMPUTER MASTER TELL ME WHICH SOFTWARE IS USED IN CALLIGRAPHY
    6·2 answers
  • 11.19 (Constructor Failure) Write a program that shows a constructor passing information about constructor failure to an excepti
    6·1 answer
  • What method of heat transfer is used when the sun heats the earth?
    14·1 answer
  • 8. _______ are used to store all the data in a database.
    7·2 answers
  • g The state of Massachusetts at one time had considered generating electric power by harvesting energy crops and burning them. A
    15·1 answer
  • 1. Identify a local or regional cause or issue for Social Change related to specific professional tracks that can be addressed o
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!