subject

Please, using C, not C+ or C++. Time it took Matthew to complete: 40 minutes
Files to submit: conversions. c
Requriements
Program must compile with both -Wall and -Werror options enabled
Submit only the files requested
Use doubles to store real numbers
Print all doubles to 2 decimal points unless stated otherwise
Restrictions
No global variables may be used
Your main function may only declare variables and call other functions
Description
In this program you will be converting measurements from one unit to another.
Temperatures
From Farenheit Celsius Kelvin
Farenheit(F) F (F - 32) * 5/9 (F-32)*5/9+273.15
Celsius(C (C * 9/5) +32 C C + 273.15
Kelvin(K) (K - 273.15) * 9/5 + 32 K -273.15 K
Distances
From Inches Feet Yards Miles
Inches(I) I I / 12 I / 36 I / 63360
Feet(F) F * 12 F F / 3 F / 5280
Yards(Y) Y* 36 Y * 3 Y Y / 1760
Miles(M) M * 63360 M * 5280 M * 1760 M
Requirements
Users should be able to enter both upper and lower case letters for units
Any amount of white space should be allowed inputs
Assumptions
Input is NOT guarenteed to be valid
If invalid input is received, your program should report it and terminate
Wait until we cover how to handle invalid input in class before dealing with this part of the problem
Tips
This problem is very large and you will want to break it down into many functions to help manage complexity
When reading in a character don't forget to put a space in front of the %c in scanf
You can save yourself a bit of work by always converting to a common unit and then converting to the desired unit
For example always converting yards first and then from yards to the desired unit
The exit function in stdlib. h can be very helpful for ending a program early. If you use it make sure to do exit(0)
Examples
Example 1
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: t
Enter the temperature followed by its suffix (F, C, or K): 0K
Enter the new unit type (F, C, or K): C
0.00K is -273.15C
Example 2
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: d
Enter the distance followed by its suffix (I, F,Y, M): 5 y
Enter the new unit type (I, F,Y, M): i
5.00Y is 180.00I
Example 3
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: J
Unknown conversion type J chosen. Ending program.
Example 4
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: 10
Invalid formatting. Ending program.
Example 5
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: t
Enter the temperature followed by its suffix (F, C, or K): 42 G
G is not a valid temperature type. Ending program.
Example 6
Pick the type of conversion that you would like to do.
T or t for temperature
D or d for distance
Enter your choice: t
Enter the temperature followed by its suffix (F, C, or K): 420 Blaze It
Invalid formatting. Ending program.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:30
What important technology has done the most to allow a businesses a chance to compete with larger international companies
Answers: 1
question
Computers and Technology, 22.06.2019 01:40
Kali, a python programmer, is using the turtle module to write the word “hello.” which code should she use to indicate the location to begin writing the word? a # pick up the turtle and move it to its starting location. b penup(-100, 200) goto() pendown() c penup() goto(-100, 200) pendown() d # pick up the turtle and move it to (-100, 200)
Answers: 2
question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 22.06.2019 10:20
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
You know the right answer?
Please, using C, not C+ or C++. Time it took Matthew to complete: 40 minutes
Files to submit:...
Questions
question
Mathematics, 30.10.2020 15:40
question
Business, 30.10.2020 15:40
question
Mathematics, 30.10.2020 15:40
question
Mathematics, 30.10.2020 15:40
question
Physics, 30.10.2020 15:40
Questions on the website: 13722367