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
On a client/server network, data does not necessarily follow the same path between the request (client) and the response (server
Andrej [43]

Answer:

SSL and HTTPS play a factor

6 0
3 years ago
Understanding the link between education and your desired career is an integral part of your career _______.
34kurt
I'm not 100% sure about my answer but based on articles I read online it makes the most sense to me.

Understanding the link between education and your desired career is an integral part of your career EXPLORATION.

The first step in career exploration is that you need to ask yourself this question "What can I do with this major?". If you have your answer, it is best to start exploring the connections that links your academic and professional interest.
7 0
3 years ago
Read 2 more answers
The application layer in the tcp/ip protocol suite is usually considered to be the combination of ________ layers in the osi mod
navik [9.2K]
Application Presentation and Session Layers.
8 0
3 years ago
HELP GENIUS Rank :))) DoNT answer If you don't know
RideAnS [48]

An instance in my life where I rendered services was when I worked in a grocery store.

The roles of entrepreneur include:

  • Allocating employees duties.
  • Improving standard of living.
  • Taking risks.

The three challenges that a young entrepreneur faces today include:

  • Financial instability.
  • Conflicts with education.
  • Lack of business skills.

The top three characteristics of an entrepreneur include:

  • Innovation.
  • Confidence
  • Risk taking

<h3>Who's an entrepreneur?</h3>

It should be noted that a entrepreneur is an individual who owns business and take risks.

The roles of entrepreneur include allocating employees duties, improving standard of living, and taking risks

Learn more about entrepreneur on:

brainly.com/question/353543

#SPJ1

3 0
1 year ago
Which of the following internet protocols is used to request and send pages and files on the World Wide Web
Marianna [84]

it is . org Explanation:

7 0
2 years ago
Other questions:
  • to prevent long page load time for pages containing images. It is best to use a compress file formatlike jpeg as well as appropr
    6·2 answers
  • Who would use a CLI? (Command Line Interface)
    9·1 answer
  • The site is not allowing me to purchase the subscription. Please help?
    12·1 answer
  • What is ur Favorite anime
    8·1 answer
  • Match the following technologies with their applications.
    11·1 answer
  • If you want to insert a column into an existing table, what would you do?
    13·2 answers
  • Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.
    15·1 answer
  • Display the total number of parking tickets.
    5·1 answer
  • Is it good to work out at the gym one day with hands then the next with feet, then a pattern?
    11·2 answers
  • Explain information technology ?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!