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
Rasek [7]
2 years ago
7

Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout << fixed

<< setprecision(2); once before all other cout statements. (1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in a vector of doubles. Output the vector's numbers on one line, each number followed by one space. (2 pts)
Computers and Technology
1 answer:
Fofino [41]2 years ago
5 0

Answer:

In C++:

#include <iomanip>

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<double> myvector;

double userinput;

cout<<"Enter 5 numbers: ";

for (int i = 1; i <= 5; i++){

 cin>>userinput;

    myvector.push_back(userinput);

}

for (int i = 0; i < 5; i++){

    cout << fixed << setprecision(2)<< myvector.at(i) <<' ';

}

return 0;

}

Explanation:

This declares the vector as double

 vector<double> myvector;

This declares a variable for input as double

double userinput;

This prompts the user for input of 5 numbers

cout<<"Enter 5 numbers: ";

This iterates from 1 to 5

for (int i = 1; i <= 5; i++){

This gets each integer input

 cin>>userinput;

This pushes each input into the vector

    myvector.push_back(userinput); }

This iterates through the vector

for (int i = 0; i < 5; i++){

This prints each vector element separated by space using fixed setprecision

cout << fixed << setprecision(2)<< myvector.at(i) <<' ';

}

You might be interested in
The ____ class act as a switchboard between the view layer and the domain layer.
nadya68 [22]

The <u>control class</u> acts as a switchboard between the view layer and the domain layer.

Explanation:

As the name suggests, the control class is responsible for performing the control actions. The view layer defines the entities and attributes which have to be viewed and their structural organization.

The domain layer consists of all the entities, attributes, and relations in the data. The control class controls the flow of information between the two layers and performs the operations of filtering and selecting the content to be displayed.  

3 0
2 years ago
a user reports that his dot matrix printer is printing dark and clear on the left of the paper but that the print is very light
yarga [219]

Answer:

Correctly position the platen of the printer to hold the paper in place.

Explanation:

Since the dot matrix printer is printing dark and clear on the left of the paper but very light on the right side of the paper, it is possible that the paper is not being held properly. So adjusting the platen will hold the paper properly and hence uniform prints on the paper.

Note: Dot matrix printers are printers that print closely related dots to form require texts (shapes) by striking some pins against an ink ribbon.

Some of the parts of these printers are; power supply, carriage assembly, Paper sensor, ribbon, platen and pins.

4 0
2 years ago
Travis sends Suri what purports to be a link to an e-birthday card, but when she clicks on the link, software is downloaded to h
12345 [234]

Answer:

Identity Theft

Explanation:

Identity theft is the act of someone who obtains details about someone else illegally.  This is done to find personal and financial information such  name, address,social security number, passwords, and credit card number, phone number, e-mail, etc. Then the hacker can use this information to control bank accounts, e-mails, computers, portray himself as you are, or sell information to someone else.

3 0
2 years ago
What is the name of a computer or application program that intercepts user requests from the internal secure network and then pr
defon
A proxy server is a server that intercepts user requests from the internal secure network and then processes that request on behalf of the user.
The proxy server can be a computer or application program<span> that gets the requests from clients and seeks resources from other </span>servers. It is a <span>intermediary point between the end user and the backbone network.</span>
8 0
2 years ago
Which type of network treats all processors equally, and allows peripheral devices to be shared without going to a separate serv
Elis [28]
The correct answer is P2P or peer-to-peer servers.

Hope I helped ;)
7 0
2 years ago
Other questions:
  • Need Help ASAP!
    14·2 answers
  • The first computer introduced was the IBM PC. A. True B. False
    11·2 answers
  • What component of Kerberos is responsible for storing keys for encrypting and decrypting data in the authentication process?
    13·1 answer
  • What is cyber ethics​
    10·2 answers
  • Video is a medium that's looks real anyways, but is real________________.
    10·1 answer
  • Question 2 of 3
    7·2 answers
  • CHOOSE THE CORRECT CONTINUOUS TENSES( PRESENT CONTINUOUS,PAST CONTINUOUS AND FUTURE CONTINUOUS) : 1. I saw a snake while I _____
    10·1 answer
  • Write a paragraph discussing privacy issues on the internet<br> and their impact on human lives.
    9·1 answer
  • E commerce is the demand of modern society both for time and money
    14·2 answers
  • Tạo biến
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!