Knowee
Questions
Features
Study Tools

Exercise 6Write a C program to compute:§ (a) Simple Interest, S.I = Principal*Rate*Time/100§ (b) Compound Interest C.I = P(1+(r/n))nt25Exercise 7Writing a C program generate for the results of the followingequations by given the values A = 12, B = 3, C = 6, D = 2:1. F = A + B/C - D ^22. F = (A + B)/ C - D ^23. F = A + B/(C - D ^ 2)4. F = (A + B)\ D ^ 226Exercise 8:Roger would like to know the average of his test scores.§ Write an equation that would calculate the average givenfive (5) test scores.§ Write a C program to solve this problem.27Exercise 928§ Write a complete C program for each of the following problem situations. Enter eachprogram into the computer, being sure to correct any typing errors. When you are sure thatit has been entered correctly, save the program, then compile and execute. Be sure toinclude prompts for all input data, and label all output.– Print HELLO! at the beginning of a line.– Have the computer print• HI, WHAT’S YOUR NAME? on one line. The user then enters his or her nameimmediately after the question mark. The computer then skips two lines and printsWELCOME (name) LET’S BE FRIENDS! on two consecutive lines. Use acharacter-type array to represent the user’s name. Assume the name contains fewerthan 20 characters.Exercise 10§ Write a C program to convert a temperature reading indegrees Fahrenheit (0F) to degrees Celsius (0C), usingthe formula,§ C = (5/9)x (F- 32).§ Test the program with the following values: 68,150,212,0, -22, -200 (degrees Fahrenheit).29Exercise 11Write a C program to calculate the volume and area of a sphere usingthe formulas:V = 4𝝅𝒓𝟐/𝟑,A = 4𝝅𝒓𝟐Test the program using the following values for the radius,r = 1, 6, 12.2, 0.2.30Exercise 1231§ Write a C program which reads a set of k integers(x1, x2, x3, …xn) from the keyboard and computethe harmonic mean.𝑴𝒆𝒂𝒏 = 𝒌𝟏𝒙𝟏 + 𝟏𝒙𝟐 , . . . , 𝟏𝒙𝒏Exercise 13§ Write a C program that accepts an employee's ID, totalworked hours of a month and the amount he received perhour.§ Print the employee's ID and salary (with two decimalplaces) of a particular month.32Exercise 14§ Write a C program that accepts the weights valuesof two items (floating points' values ) and numberof purchase (floating points' values) and calculatethe average value of the items.33Exercise 15§ Write a C program that accepts two integersfrom the user and calculate the sum andproduct of the two integer

Question

Exercise 6Write a C program to compute:§ (a) Simple Interest, S.I = PrincipalRateTime/100§ (b) Compound Interest C.I = P(1+(r/n))nt25Exercise 7Writing a C program generate for the results of the followingequations by given the values A = 12, B = 3, C = 6, D = 2:1. F = A + B/C - D ^22. F = (A + B)/ C - D ^23. F = A + B/(C - D ^ 2)4. F = (A + B)\ D ^ 226Exercise 8:Roger would like to know the average of his test scores.§ Write an equation that would calculate the average givenfive (5) test scores.§ Write a C program to solve this problem.27Exercise 928§ Write a complete C program for each of the following problem situations. Enter eachprogram into the computer, being sure to correct any typing errors. When you are sure thatit has been entered correctly, save the program, then compile and execute. Be sure toinclude prompts for all input data, and label all output.– Print HELLO! at the beginning of a line.– Have the computer print• HI, WHAT’S YOUR NAME? on one line. The user then enters his or her nameimmediately after the question mark. The computer then skips two lines and printsWELCOME (name) LET’S BE FRIENDS! on two consecutive lines. Use acharacter-type array to represent the user’s name. Assume the name contains fewerthan 20 characters.Exercise 10§ Write a C program to convert a temperature reading indegrees Fahrenheit (0F) to degrees Celsius (0C), usingthe formula,§ C = (5/9)x (F- 32).§ Test the program with the following values: 68,150,212,0, -22, -200 (degrees Fahrenheit).29Exercise 11Write a C program to calculate the volume and area of a sphere usingthe formulas:V = 4𝝅𝒓𝟐/𝟑,A = 4𝝅𝒓𝟐Test the program using the following values for the radius,r = 1, 6, 12.2, 0.2.30Exercise 1231§ Write a C program which reads a set of k integers(x1, x2, x3, …xn) from the keyboard and computethe harmonic mean.𝑴𝒆𝒂𝒏 = 𝒌𝟏𝒙𝟏 + 𝟏𝒙𝟐 , . . . , 𝟏𝒙𝒏Exercise 13§ Write a C program that accepts an employee's ID, totalworked hours of a month and the amount he received perhour.§ Print the employee's ID and salary (with two decimalplaces) of a particular month.32Exercise 14§ Write a C program that accepts the weights valuesof two items (floating points' values ) and numberof purchase (floating points' values) and calculatethe average value of the items.33Exercise 15§ Write a C program that accepts two integersfrom the user and calculate the sum andproduct of the two integer

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Sure, here are the solutions for the first three exercises:

Exercise 6:

#include<stdio.h>

int main() {
    float principal, rate, time, SI, CI;
    printf("Enter principal, rate and time: ");
    scanf("%f %f %f", &principal, &rate, &time);
    SI = (principal * rate * time) / 100;
    CI = principal * (pow((1 + rate / 100), time));
    printf("Simple Interest = %f\n", SI);
    printf("Compound Interest = %f\n", CI);
    return 0;
}

Exercise 7:

#include<stdio.h>

int main() {
    float A = 12, B = 3, C = 6, D = 2, F;
    F = A + B/C - pow(D, 2);
    printf("F = %f\n", F);
    F = (A + B)/ C - pow(D, 2);
    printf("F = %f\n", F);
    F = A + B/(C - pow(D, 2));
    printf("F = %f\n", F);
    F = (A + B)/ pow(D, 2);
    printf("F = %f\n", F);
    return 0;
}

Exercise 8:

#include<stdio.h>

int main() {
    float score1, score2, score3, score4, score5, average;
    printf("Enter five test scores: ");
    scanf("%f %f %f %f %f", &score1, &score2, &score3, &score4, &score5);
    average = (score1 + score2 + score3 + score4 + score5) / 5;
    printf("Average = %f\n", average);
    return 0;
}

Please let me know if you need solutions for the remaining exercises.

This problem has been solved

Similar Questions

Write a C program to compute:§ (a) Simple Interest, S.I = Principal*Rate*Time/100§ (b) Compound Interest C.I = P(1+(r/n))nt25

Jane is evaluating different investment options for her savings. She wants to know whether simple interest or compound interest will yield a better return over a given period. Create a program to help Jane compare the two options based on her principal amount, annual interest rate, and the time period in years.Input format :The input consists of three double values: the principal amount (p), the annual interest rate (r), and the time period(n) in years.Output format :The first line of output prints the simple interest, rounded off to one decimal place.The second line prints the compound interest, rounded off to one decimal place.The third line prints one of the following:If compound interest is greater than simple interest, print "Recommendation: Compound Interest is a Better Investment".Otherwise, print "Recommendation: Both Simple and Compound Interest are Equal".Refer to the sample output for formatting specifications.Code constraints :100.00 ≤ p ≤ 10000.000.00 ≤ r ≤ 15.001.00 ≤ n ≤ 50.0Sample test cases :Input 1 :1500.000.031.0Output 1 :Simple Interest is 45.0Compound Interest is 45.0Recommendation: Both Simple and Compound Interest are EqualInput 2 :2000.750.046.5Output 2 :Simple Interest is 520.2Compound Interest is 581.0Recommendation: Compound Interest is a

A divided money between two sons B and C. The amount received by B after 13 years is equal to the amount received by C in 15 years at the rate of 4% p.a. compound interest. The difference between their shares is INR 102. Find the amount in total (in INR)2702125013522602

Complete the table to determine the balance A for $21,000 invested at rater = 5% for t years, compounded continuously.Step 1Write the formula for continuously compounded interest in terms of the principal investment P, the rate r, and time t.A =

Payments of 800, 500 and 700 are made at the ends of years 2, 4, and 6 respectively. Giventhat the effective interest rate is 13%, find the time point at which single payment of 2100would be equivalent

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.