Question
Write a function called testneg with one input and no outputs. The function will test to see if the input value is negative. If it
Write a function called testneg with one input and no outputs. The function will test to see if the input value is negative. If it is negative, use fprintf to print the message to the screen Warning: The input value n is negative. where n is not literally the letter n, but is the value of the input to the function. Assume the input value is a floating-point number, so use an appropriate format in the fprintf to print the value with 2 decimal places. If the value of the input is not negative, dont print anything. 2. Write a function to test if a number is between 10 and 20. It will have one input (the number to be tested) and no outputs. If the number is between 10 and 20, print an appropriate message. If not, also print an appropriate message. 3. A particular type of wind turbine can have 2, 3, or 4 blades. The more blades, the higher the power of the turbine. Write a function with one input and no outputs, where the input is the number of blades. Use a switch statement to write to the screen Low Power Medium Power or High Power where Low Power corresponds to 2 blades, Medium Power corresponds to 3 blades, and High Power corresponds to 4 blades. 4. Below is a chart of the classification of egg sizes from Wikipedia. Write a function with one input and no outputs. The input will be the weight of an egg in ounces. The function will print the egg size to the screen in the following format Weight = n oz Size = size classification where n is the input weight of the egg and size classification is Jumbo, Large, etc. Note that the values in the table are the minimum weights for each classification.
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