These lab assignments are collected from IGNOU lab assignment book BCSL-021. Solve these questions yourself then read the solutions presented here.
C Lab Assignment | BCSL-021
Exercise 1. Develop algorithm, flowchart and write an interactive program to calculate simple interest and compound interest.
Exercise 2. Design a flow chart and write an interactive program for the problem given below:
Assume that the United States of America uses the following income tax code formula for their annual income:
First US$ 5000 of income : 0% tax
Next US$ 10,000 of income : 10% tax
Next US$ 20,000 of income : 15% tax
An amount above US$ 35,000 : 20% tax.
For example, somebody earning US$ 38,000 annually would owe US$ 5000 X 0.00 + 10,000 X 0.10 + 20,000 X 0.15 + 3,000 X 0.20,
which comes to US$ 4600. Write a program that uses a loop to input the income and calculate and report the owed tax amount. Make sure that your calculation is mathematically accurate and that truncation errors are eliminated.
Exercise 3. Design a flowchart and write an interactive program that reads in integers until a 0 is entered. If it encounters 0 as input, then it should display:
- the total number of even and odd integers
- average value of even integers
- Average value of odd integers.
Note: Use switch statement for selection.
Exercise 4. Write an interactive program to generate the divisors of a given integer.