This document contains 4 practice problems for a structured programming language course:
1) A problem to convert age in years, months, and days to total days.
2) A problem to calculate GPA based on grades from 4 theory courses.
3) A problem to calculate the area of a trapezoid given the lengths of the parallel sides and height.
4) A problem to calculate the area of a triangle given the lengths of the 3 sides.
This document contains 4 practice problems for a structured programming language course:
1) A problem to convert age in years, months, and days to total days.
2) A problem to calculate GPA based on grades from 4 theory courses.
3) A problem to calculate the area of a trapezoid given the lengths of the parallel sides and height.
4) A problem to calculate the area of a triangle given the lengths of the 3 sides.
This document contains 4 practice problems for a structured programming language course:
1) A problem to convert age in years, months, and days to total days.
2) A problem to calculate GPA based on grades from 4 theory courses.
3) A problem to calculate the area of a trapezoid given the lengths of the parallel sides and height.
4) A problem to calculate the area of a triangle given the lengths of the 3 sides.
Practice Problems Problem 1 • Suppose you know your age in years, months and days ( For example 19 years, 8 months and 21 days ) and now you want to know your age in days only. Write a C program to take the inputs in years, months and days and show the output in days. You can use (1 year = 365 days and 1 month = 30 days) Problem 2 Suppose you took 4 theory courses in a semester and did not have and lab courses. You know the individual grades you got from these courses. Write a C program that will take input the grades of the 4 courses and will calculate and show the GPA of that term. Problem 3
The area of a trapezium is the product of the average of length
of two parallel sides and the height of it. Write a C program to take input the lengths of two parallel sides and the height. You have to give the area of the trapezium as output. Problem 4 Write a C program that will take the lengths of the three arms of a triangle as input and give the area of the triangle as output. Find what’s wrong in this code.