You are on page 1of 2

Lab test 4 (6% of lab assessment)

Submit your hardcopy on 6th August 2015. You are also required to show me your
completed COBOL program during lab session for grading purposes. Programs with
no errors and display the required output will get higher marks.

Question 1
Write a COBOL program using PERFORM VARYING statement that will count 45,
40, 35, 30, 25.

Question 2
The number of calories burned per hour by cycling, jogging and swimming are 200,
475 and 275 respectively. A person loses 1 kilogram of weight for each 3500
calories burned. Write a COBOL program that allows the user to input the number
of hours spent at each activity and then calculates the number of kilogram
worked of.
Sample output:
Enter number of hours you spent for cycling: 2
Enter number of hours you spent for jogging: 3
Enter number of hours you spent for swimming: 1

Total kilogram worked off : 0.6 kg


Question 3
Miss Raihana wants to calculate the total marks a student get for the midterm
test. This program will receive the total number of questions, marks that a
student get for each question as well as the full marks for the test. Given
below is a sample run of the program. Your program should include PERFORM
statement that will interactively input marks (repetitively) based on the total
number of questions.

Number of questions:
5
Full marks:
50
Enter the marks for each question:
Question 1
10
Question 2
10
Question 3
8
Question 4
9
Question 5
6
Total Marks: 43/50

You might also like