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]
3 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]3 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
25 POINTS!!!!!!!!!!!!!
siniylev [52]

Answer:

im pretty sure its digital footprint

Explanation:

3 0
3 years ago
Two people, Alice and Bob are using the key sharing algorithm. They have chosen a clock size of 17 and a base of 5. Alice's priv
hjlf

Answer:

fsfsf

Explanation:

6 0
3 years ago
What theorems do we need to know for ap calculus ab.
USPshnik [31]

Answer: Intermediate Value Theorem.

Extreme Value Theorem.

Mean Value Theorem for Derivatives.

Rolle's Theorem.

Fundamental Theorem of Calculus (two parts)

Mean Value Theorem for Integrals.

Explanation:

4 0
3 years ago
A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spe
77julia77 [94]

Answer:

Answer: Program to estimate the power spectral density of the signal

Explanation:

fs= 4000; % Hz sample rate Ts= 1/fs; f0= 500; % Hz sine frequency A= sqrt(2); % V sine amplitude for P= 1 W into 1 ohm. N= 1024; % number of time samples n= 0:N-1; % time index x= A*sin(2*pi*f0*n*Ts) + .1*randn(1,N); % 1 W sinewave + noise

Spectrum in dBW/Hz

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_Hz= 10*log10(pxx); % dBW/Hz

Spectrum in dBW/bin

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_bin= 10*log10(pxx*fs/nfft); % dBW/bin

7 0
3 years ago
on average, someone with a bachelor’s degree is estimated to earn _______ times more than someone with a high school diploma
adoni [48]
Maybe Less Than two Times

High School Diploma = 1,304,000

Bachelor's degree = 2,268,000
7 0
3 years ago
Other questions:
  • Wired Equivalent Privacy (WEP) is an IEEE 802.11 wireless protocol which provides security algorithms for data confidentiality d
    14·1 answer
  • // This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
    12·1 answer
  • A(an) _______ is a set of instructions that a computer follows to perform a task.
    6·1 answer
  • If you attempt an edgeunity quiz is your latest attempt the one counted?
    10·1 answer
  • What is the output of the following code<br> X = 06<br> y = 0<br> print (x ** y)
    12·1 answer
  • Common separators or delimiters used when converting a table to text include _______________________ , paragraph marks, or comma
    14·1 answer
  • The advancement of technology in our daily lives has changed how we interact with the world.
    10·1 answer
  • What percentage of teens say they have witnessed cyberbullying?
    6·2 answers
  • Ryan is developing a camera app for iOS with the following objectives: make it easier for users to choose and sort pictures; and
    8·1 answer
  • Using the _____, you can direct the browser to retrieve specific information about the URL, to reload the current page, or to lo
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!