Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete the following in c programming language and add comments in each code 5. Write a program to read a float representing a number

Please complete the following in c programming language and add comments in each code

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

5. Write a program to read a "float" representing a number of degrees Celsius (C), and print as a "float" the equivalent temperature in degrees Fahrenheit (F). Print your results in a form such as : 100.0 degrees Celsius converts to 212.0 degrees Fahrenheit. N.B. : C=5/9(F32), where C represents the temperature in Celsius and F is the temperature in Fahrenheit. 6. Write a program that reads your height (in inches) and weight (in pounds) and determines your BMI. BMI Formula: 703 x weight / [height] 2 7. Write a program to accept a number and determine whether it is positive or negative. HINT: Use an if statements 8. Update your program written in 7 above to cater for zero. 9. Write a program to accept a number and determines whether it is even or odd. 10. Write a program to accept two numbers and determines which one is larger. 11. Write a program to accept a test score (integer value) out of 100 and detcrmincs whether they passed of failcd. Apply the following scheme: 0 to 40 - Fail 50 to 100 - Pass Negative numbers or numbers greater than 100 - Error 12. Write a program to accept a person's age (as an integer value) and determine whether they are a child, teen and/or adult. Apply the following scheme: Child - 1 to 12 Teen - 13 to 19 Adult - 18 and over I received 60 out of 100 on a test. Write a program to determine my grade by a. using if statements b. using switch Apply the following grading scheme: A - 75 and over B - 65 to 74 C - 50 to 64 D - 40 to 49 F - less than 40 Write a program to read a number of units of length (a 14. float) and print out the area of a circle of that radius. Assume that the value of pi is 3.14159. Your output should take the form: The area of a circle of radius. units is... units squared. Note: Substitute the word units to suit the specific ones that you utilised e.g. cm etc. 15. Given as input an integer number of seconds, print as output the equivalent time in hours, minutes and seconds. Recommended output format is something like: 7322 seconds is equivalent to 2 hours 2 minutes 2 seconds. 16. The cost of a new car is the sum of the wholesale cost, the local sales tax and the dealer's percentage markup. Assuming the dealer's mark-up is 10 percent of the wholesale cost and the sales tax is 6 percent, write a program to read a car ID (an integer value) and the wholesale cost of the car (a float value) and print the car ID and the cost to the consumer

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What preparations must be made before a committee meeting is held?

Answered: 1 week ago

Question

75 words please What are the Mutual fund's goals

Answered: 1 week ago

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago