
I'm doing something wrong but I'm not sure what. This is in C++.
Question
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
2) Also output the total weight, by summing the vector's elements.
3) Also output the average of the vector's elements.
4) Also output the max vector element.
I've attached images of what I did and the output full of errors.
Default template:
#include <iostream>
#include <iomanip> // For setprecision
// FIXME include vector library
using namespace std;
int main() {
/* Type your code here. */
return 0;
}
Thank you



Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- c++arrow_forwardhelp me solve this in c++ please Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square. Notes Create the square by filling the numbers entered from left to right, top to bottom. Input validation - Do not accept numbers outside the range. Do not accept repeats. Must use two-dimensional arrays in the implementation. Functional decomposition — Program should rely on functions that are consistent with the algorithm.arrow_forwardNEED C++ HELP WITH WRITING VECTORS WITH CLASSES Write code to read a list of song durations and song names from input. For each line of input, set the duration and name of currSong. Then add currSong to playlist. Input first receives a song duration, then the name of that song (which you can assume is only one word long). Input example: 424 Time383 Money-1 CODE AS IS NOW #include <iostream>#include <string>#include <vector>using namespace std; class Song { public: void SetDurationAndName(int songDuration, string songName) { duration = songDuration; name = songName; } void PrintSong() const { cout << duration << " - " << name << endl; } int GetDuration() const { return duration; } string GetName() const { return name; } private: int duration; string name;}; int main() { vector<Song> playlist; Song currSong; int currDuration; string currName; unsigned int i;…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





