Description
Problem 1
Write a program division.c that reads two integers to num and denom and prints the result of
integer division (num/denom), rounding away from zero followed by \n character. Assume denom is
not zero.
Sample Input #1
0 4
Sample Output #1
0
Sample Input #2
2 7
Sample Output #2
1
Sample Input #3
-5 4
Sample Output #3
-2
Sample Input #4
-618 -150
Sample Output #4
5
Sample Input #5
10 6
Sample Output #5
2
Page 3 of 4
Problem 2
Write a program pizzas.c that reads three positive integers to num_people,
slices_per_pizza, and slices_each, and prints how many whole pizzas are required to feed
num_people if each person eats slices_each slices, for the given number of
slices_per_pizza. The printed result is followed by \n character.
Sample Input #1
1 2 3
Sample Output #1
2
Sample Input #2
1 5 1
Sample Output #2
1
Sample Input #3
1032 11 14
Sample Output #3
1314
Sample Input #4
10 10 10
Sample Output #4
10
Page 4 of 4
Problem 3
A final grade in CS101 is calculated according to the following category weights:
• Quizzes are worth 5%
• Assignments are worth 20%
• Midterm is worth 30%
• Final exam is worth 45%
To pass the course, the following two conditions must be met, where Q, A, M, and F represent a
student’s grades for quizzes, assignments, midterm, and final exam respectively (all between 0 and 100,
inclusive):
1) Students must earn at least 50% based on the standard grade calculation:
2) Students must pass the weighted exam average:
Write a C Program grades.c that reads three non-negative numbers between 0 and 100 (inclusive),
corresponding to a student’s grades on quizzes, assignments, and the midterm exam. The program
prints the minimum grade in the final exam rounded down, which will meet both of the required
conditions explained above.
Sample:
Sample input 1: 80 90 60 Output: 43
Sample input 2: 50 40 30 Output: 67
Sample input 3: 10 5 0 Output: 107
Note that if your program prints a number above 100, as in the last example, that means that the course
cannot be passed, as the final exam grade cannot be greater than 100. However, for the purposes of this
question, do not make any adjustments to your calculation. The program must print the value needed to
meet both requirements (followed by \n).


