lab3 - Marks Alphabetical grade Grade point 80-100 A 4.00...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECC 3101- Computer Programming Lab Sheet 3- if-else statement 1. Write a program that allows the user to input marks of 5 subjects, i.e; marks between 0 - 100. Give input of credit hours for every subject and declare them as integer data types. The program must calculate the average mark, and state the number of marks less than 65. Then, determine the grade of each input according to the marking scheme below using if-else statement. Finally, calculate and print the Cumulative Grade Point, which equals to total of grade point divide with total credit hours. Use cast statement to the credit hours for this calculation.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Marks Alphabetical grade Grade point 80-100 A 4.00 75-79 A-3.75 70-74 B+ 3.50 65-69 B 3.00 60-64 B-2.75 55-59 C+ 2.50 50-54 C 2.00 47-49 C-1.75 44-46 D+ 1.50 40-43 D 1.00 39 or less F 2. Write a program that prompts the user to enter an integer and determines whether it is divisible by 5 and 7, whether it is divisible by 5 or 7 and whether it is divisible by 5 or 7 but not both. Here is a sample runs of this program: Enter an integer: 10 Is 10 divisible by 5 and 7? False Is 10 divisible by 5 or 7? True Is 10 divisible by 5 or 7, but not both? True...
View Full Document

This note was uploaded on 10/17/2008 for the course ECC 3102 taught by Professor Burney during the Spring '08 term at Punjab Engineering College.

Ask a homework question - tutors are online