Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I cant figure out how to do this for the life of me. I have been working on it for almost 6 hours now and
I cant figure out how to do this for the life of me. I have been working on it for almost 6 hours now and I cant get it. This is my second week of c++ and its kicking my butt so if you could give some explanation to the answer as well as the answer that would be sweet! thanks! Purpose: Do some computations. Description: Create a C program that produces a table similar to the one shown below: Table of Olympic running distances ================================== Meters Kilometers Yards Miles ------ ---------- ----- ----- 100 200 400 800 1500 that computes the equivalent distances using the following conversion factors: 1 m = 0.001 km 1 m = 1.094 yd 1 m = 0.0006215 mi Notes: ----- - No inputs required, just generate the table - Nicely format and label your output. - Make the table look good - Use field-width & precision with the conversion specifiers to align columns and to give a reasonable number digits after the decimal point. Adjust columns as you see fit. - Right justify numbers in the column under their respective heading {See pages 115-121 in Prata & 23 in McGrath for details and examples on using field-width and precision with conversion specifiers. } - Gradually develop your program in steps: - You will likely have to "fiddle around" to get the table layout the way you want it. So spend some time just figuring out how to have the printf( ) formatting keep things aligned. - You should be able to use the same field-width values down one entire column to keep your output aligned. This should make it easier to adjust any column if you find out you don't have it set right.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started