Question: Part 1: 1. Write a C program that helps you to complete Self-Check Questions 1 in Section 3.2 on Page 123. Hints: a. You need

Part 1: 1. Write a C program that helps you to complete Self-Check Questions 1 in Section 3.2 on Page 123. Hints: a. You need to declare a variable for x, y, z, u, v, w, assign them some initial values, and declare a variable to hold the result of the expressions, add one printf statement to print the value of the result. b. Make sure that you include the declarations of C library functions.

2. Write a C program to complete Programming Exercise Question 3 in Section 3.4 on Page 136. Hints: You need to write a function named print_instruction(), place its prototype before main() and its definition after main(). Then inside main(), call this function after variable declaration. NOTE: The questions in Part 1 are NOT required to submit.

Part 2: 1. Complete the MODIFIED programming project 1 in Page 167. Implementation requirements: a. You MUST write a function that calculates the monthly payment based on the principal, monthly interest rate, and total number of payments.

b. You must get the principal, monthly interest rate, and total number of payments from user inside main(), then pass these values to this function in a. above, then print the computed monthly payment inside main().

c. You dont get user input inside this function in a. above. Hints: The function in a. above is a function with multiple input arguments and one return result. It is like the function scale() in Figure 3.23 on Page 142. Your main() function is like the main() in Figure 3.24 on Page 143. Your entire program is like the entire program in Figure 3.24 on Page 143.

Part 1: 1. Write a C program that helps you to complete

THE QUESTIONS ARE FROM THE PROBLEM SOLVING AND PROGRAM DESIGN IN C

3 runctions with Input Arguments 143 FIGURE 3.24 Testing Function scale 2Tests function scale. /* printf, scanf definitions / /* pow definition */ 4include 15. #include 7./ Function prototype */ 8. double scale(double x, int n)i 9. 10. int 1 main(void) 13 14 double num_1: int num_2 /* Get values for num_1 and num_2 */ printf("Enter a real number> "): scanf("%lf", &num1 ) ; printf( "Enter an integer> ")i scanf ( "%d" , &num2); 17 18. an - the / call scale and display result. / printf( "Result of call to function scale is 8fln, scale (num 1, num_2)): actual arguments return (0); 27 double 31, scale(double x, int n) formal parameters /* local variable 10 to power n */ double scale_factori scalefactor = pow (10, n); return (x scale_factor) - Enter a real number> 2.5 Enter an integer>2 Result of call to function scale is 0.025

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!