Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So i have this homework question and I did it this way which it was wrong , i had some comments on how it should've

So i have this homework question and I did it this way which it was wrong , i had some comments on how it should've done can you please help me resolving the question? so I can understand how it should've be been done and we are my mistakes.

https://onlinegdb.com/GBEyKGIqA

The comment was: The remaining code isn't flexible. Meaning, you are artificially putting in the right number of spaces to look good. If the numbers change, you'd have to change the spaces as well. That's inefficient and inflexible. The setw() function can pad the display to make sure that the same number of spaces are used per display.

image text in transcribedimage text in transcribedimage text in transcribed
2) (15 points) Formatting Output: Take the following code (https://onlinegdb.com/r19df2_EE) and produce the output shown below. To do so, you will have to include the appropriate library and then include a variety of formatting options within cout. Note that specifically, you should be: Aligning left Printing out 2 decimal digits Using a constant number of spaces so if I were to change your data, list 2 would still be completely left justified. List 1 List 2 12 . 42 11 .00 1252 . 21 652 . 30 1 . 10 1 . 30 Program finished with exit code 0 Press ENTER to exit console.\f\f

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions