Question: Part 1 : Program Design, implement, compile, and test C solutions to the following problems. Write a program that prompts the user for two integer

Part 1: Program
Design, implement, compile, and test C solutions to the following problems.
Write a program that prompts the user for two integer numbers (called number1_int and number2_int) and two floating-point numbers (called number1_float and number2_float).
The code for declaring the variables and prompting the user is given below (please write the code into your .c file):
image.png
Perform the following operations on the numbers:
Add number1_int and number2_int together and print the result as an integer value.
Subtract number1_float from number2_float and print the result as a floating-point value.
Multiply number1_int by number1_float and print the result as an integer value.
Divide number1_int by number2_int and print the result as an integer and a floating-point value (Ask yourself: What happens when you divide an integer by an integer? Does the result change because you print it as a floating-point number?).
Divide number1_int by number2_float and print the result as an integer and a floating-point value (Ask yourself: How does this compare to the previous operations? We are now dealing with mixed data types).
Explicitly cast number1_int as a floating-point value and divide by number2_int. Print the result as a floating-point value.
Try to mod number1_float by number2_float. Does the program compile? If not, fix it so that it does.
Determine if number1_int and number2_int are even or odd. Print 0 if even and 1 if odd. You may not use if statements. Use the mod operator instead.
V. Part 2:
Write a program that prompts the user for inputs into Joules Law and determines the power. Print the power value. Joule's Law: P =(V^2)/ R, where P is the power, V is the voltage, and R is the resistance of the circuit (all values are integers). Do we have loss of precision? What kind of division is being performed?
Write a program that prompts the user for inputs into the third-order polynomial equation provided and determines the y value. Print the y value. The third-order polynomial equation is: y =3* a * x^3+(1/4)* b * x^2+10* c * x +(-5)* d (x, y, a, b, c, and d are integer numbers). Be careful here! What is (1/4) as an integer result? We do not want integer division in this case! How do we fix it? Do we ultimately have loss of precision?
Write a program that prompts the user for inputs into the circumference of a circle equation provided and determines the circumference value. Print the circumference value. Circumference of a circle: circumference =2* PI * radius (circumference and radius are floating-point numbers; PI should be defined as a constant floating-point number and should not be entered by the user).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!