Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help programing ths in C. Don't worry about part 1. Thank you! Your task is to design and implement the following functions Description given

need help programing ths in C. Don't worry about part 1. Thank you!image text in transcribed

Your task is to design and implement the following functions Description given an integer value, returns the same integer rounded to the nearest multiple of 100 e.g., 137 would round down to 100, 153 would round up to 200, etc given an integer value, returns true if the integer is odd, and false if it is even given a number x (which is not necessarily an integer), returns the value of 3x6x + 12 given a temperature t in Celsius (not necessarily an integer), return the equivalent temperature in Fahrenheit, which is (t x 9/5) + 32 Function name roundToNearest100 isodd 0 celsiusToFahrenheit Part 1: Design For each function, create a design artifact, including input (parameters) and output (return value). Discuss your design with your neighbors. Did you agree on what parameters and parameter data types are needed? Did you agree on the return type? Part 2: Implementation and Testing For each function, add a prototype and function definition to the program. To test a function, add at least four assertions to the main function. An assertion tests a function by calling the function with hard coded values, and verifies that the correct result is returned. An example function called addInts is provided, along with several test assertions When you run the program, it will print All tests passed! if all of the tests succeed. Otherwise, you will see a message about a failed assertion. This means that either the function returned the wrong value, or the test is incorrect. Hints The bool type is appropriate for representing the values true and false A good way to specify an expected value for a function that does a numeric computation is to specify the expected value as the same computation on whatever hard-coded value or values were passed to the function. For example, to test the celsiusToFahrenheit function, you might specify the assertion as assert (celsiusToFahrenheit(49.5)((49.59.0) /5.0) 32.e)

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

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago