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
Can someone please help me with 6.8 Code Practice adhesive.
Ivahew [28]

Answer:

I'm looking for this one too

8 0
2 years ago
Read 2 more answers
Both the Alphabetic Index and the Tabular List must be used to locate and assign a diagnosis code in ICD-10-CM. Group of answer
Viefleur [7K]

Answer:

The answer is "True".

Explanation:

The Alphabetic Index, as well as the Table List or Tabular List, both codes are important for finding and assigning a code. These codes are not always the complete code, in the Alphabetic List.  

  • The full code, including laterality and any seven characters appropriate, may only be found on the Tabular List.  
  • Both codes use topography codes which are denoted by the letter C.

8 0
2 years ago
What provides access to the internet?
Sphinxa [80]
A router!
12345678901234567890
6 0
3 years ago
Write a program that asks the user for the number of males and the number of females registered in a class. The program should d
Bond [772]

Answer:

import java.util.Scanner;

public class PercentagePopulation {

public static void main(String[] args) {

 // 1. Create an object of the Scanner class

 // This will allow for user's inputs

 Scanner input = new Scanner(System.in);

 // 2. Create a prompt asking the user to enter the number of males

 System.out.println("Please enter the number of males");

 // 3. Receive the number entered by the user and store in an int

 // variable called  number_of_males.

 int number_of_males = input.nextInt();

 // 4. Create a prompt asking the user to enter the number of

               // females

 System.out.println("Please enter the number of females");

 // 5. Receive the number entered by the user and store in an int

 // variable  called, number_of_females

 int number_of_females = input.nextInt();

 // 6. Find the sum of the number of males and females

 // Store the result in an int variable called total.

 int total = number_of_males + number_of_females;

 // 7. Find the percentage of males by using the appropriate

 // formula.  Do a type-casting to allow for division in floating point

               // representation by prepending the number_of_males by (double)

 double percentagemales = (double) number_of_males / total * 100.0;

 // 8. Find the percentage of females by using the appropriate

 // formula.  Do a type casting to allow for division in floating point

               // representation by prepending the number_of_males by (double)

 double percentagefemales = (double) number_of_females / total * 100.0;

 // 9. Print out the results

 System.out.println("Percentage males : " + percentagemales + "%");

 System.out.println("Percentage females : " + percentagefemales + "%");

}

}

Explanation:

Please go through the comments in the code to give an explanation of the program. The source code file has also been added to this response. Please download it and go through it.

Download java
4 0
3 years ago
Write the name of the tab, the command group, and the icon that you need to use to justify text
const2013 [10]

Answer and Explanation:

In order to use the justified text

The name of the tab is the Home tab

The command is

First select the data in which you want to justify

Than go to the home tab after that go to the paragraph tab and then click on the dialog box launcher after that choose the drop-down menu of alignment and set justified text

The shortcut key is to use it is Ctrl + J

4 0
3 years ago
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n _
    14·1 answer
  • How many times do you usually use npm?<br> Put your answer in the box.
    6·1 answer
  • 1. Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name
    6·1 answer
  • Write an examples of Output device, storage devices and inputs device 10 each excluding the common ones​
    5·1 answer
  • To rename a database object, press and hold or right-click the object in the navigation pane and then tap or click ____ on the s
    10·1 answer
  • When computing the cost of the basket of goods and services purchased by a typical consumer, which of the following changes from
    11·1 answer
  • Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit
    10·2 answers
  • I need to reverse a inputted word using for loops with range 0 to the input word and increment 1.
    5·1 answer
  • Write if true or false
    11·1 answer
  • Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!