Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use C Modify main.c to convert metric lengths (meters, etc.) from arbitrary metric unit to arbitrary metric unit. You should read and answer the Questions

use C image text in transcribed
image text in transcribed
image text in transcribed
Modify main.c to convert metric lengths (meters, etc.) from arbitrary metric unit to arbitrary metric unit. You should read and answer the Questions in the questions file as well. HINT: Do the input and output parts first before starting the conversion part. For example: the user may input 680.3 km to Mm and your program will output: 600.300 km is 0.680 MM Another Sample input/output: 5000 m to km 500e.ee mis 5.000 km You must support the following metric prefixes ON the output should not include M - 1046 k - 18^3 . - 1 (useIf you wish to input just meters, e.g. 5'm the ", just m) d . 10^-1 c. 10^-2 10.3 26 29 30 31 You must output your numbers with 3 decimal places. You must define the conversion factors above as constants in your code. Think carefully and design your approach before starting. This can be done in about 1 1.5 printed page of code. Jumping in immediately may make your code get huge and lead to extra work. Saveu 1 Before you begin coding, describe your approach to solving the problem by laying out the steps your program will take. 2. What changed in your design during the process of writing the code? (if anything) 3. Did you test every input case? Every conversion between different units? Why or why not? main.c @ saved include #define MEGA 1.0E6 // one million meters in a Megameter. Bodvou WN int main() { // variables definitions 1/Prompt for input printf(" Welcome to the metric length converter: "); printf(" Input Example: 5 km to cm") // Get input F/Do conversion print output return

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions