Assignment #5
Grade Calculation
________________________________________
Problem Statement :
Write a program to calculate average test grades for a class. The number of tests per students and the number of students in the class must be variable. That means that your program should accept any number of tests or students (as input data) without any changes in the source code (look at examples below). Other input data will be student names and their test grades. Run the program using examples given below, and at least one of your own.
Interactive Session Example:
(prompt ‘>’ denotes output provided by your program (to distinguish it from user provided data – it should not be printed by your program) :
Example 1 :
>ENTER NUMBER OF STUDENTS IN THE CLASS :
3
>ENTER NUMBER OF TESTS PER STUDENT :
3
>ENTER THE NAME OF STUDENT NUMBER 1 :
BROWN
>ENTER GRADE 1 :
50
>ENTER GRADE 2 :
60
>ENTER GRADE 3 :
70
>
>*******************************************
>* THE FINAL GRADE FOR STUDENT BROWN IS 60 *
>*******************************************
>
>ENTER THE NAME OF STUDENT NUMBER 2 :
JONES
>ENTER GRADE 1 :
70
>ENTER GRADE 2 :
80
>ENTER GRADE 3 :
90
>
>*******************************************
>* THE FINAL GRADE FOR STUDENT JONES IS 80 *
>*******************************************
>
>ENTER THE NAME OF STUDENT NUMBER 3 :
RITT
>ENTER GRADE 1 :
50
>ENTER GRADE 2 :
70
>ENTER GRADE 3 :
90
>
>*******************************************
>* THE FINAL GRADE FOR STUDENT RITT IS 70 *
>*******************************************
>END.
Example 2:
>ENTER NUMBER OF STUDENTS IN THE CLASS :
2
>ENTER NUMBER OF TESTS PER STUDENT :
4
>ENTER THE NAME OF STUDENT NUMBER 1 :
CLOVER
>ENTER GRADE 1 :
50
>ENTER GRADE 2 :
60
>ENTER GRADE 3 :
70
>ENTER GRADE 4 :
80
>
>********************************************
>* THE FINAL GRADE FOR STUDENT CLOVER IS 65 *
>********************************************
>
>ENTER THE NAME OF STUDENT NUMBER 2 :
MOLKS
>ENTER GRADE 1 :
70
>ENTER GRADE 2 :
80
>ENTER GRADE 3 :
90
>ENTER GRADE 4 :
100
>
>*******************************************
>* THE FINAL GRADE FOR STUDENT MOLKS IS 85 *
>*******************************************
>END.
ASSIGNMENT 6
Assignment #6
Credit 2
________________________________________
Problem Statement :
Part 1
Write a program that will process one application for credit card KREDA. The following data has to be provided as input :
Data Acceptable Range
-------------------------------------------
age >0 and <200
name
monthly income > 0
credit rating "good"' or "bad"
house owner "yes" or "no"
permanent job "yes" or "no"
Remember to use prompt messages when asking for input. You do not have to check for acceptable range at this point.
Approval conditions :
• nobody under 16 can get the card.
• everybody over (or exactly) 16 who has a good credit will have their applications approved.
• for those that do not meet the above condition, application will be approved if they own the house.
• for those that do not meet the above condition, application will be approved if they have a permanent job, and their monthly income is over $3000.00.
• all others will have their application denied.
Example of the program output :
(This is only the final output, interactive session that you will need in order to get the data is omitted)
>*****************************
>
> KREDA CARD APPLICATION
>
> Name : Hughes Howard
> Age : 153
> Monthly Income : $100000
> Credit Rating : GOOD
> Owns House : YES
> Has Permanent Job : NO
>
> ***********************
> *APPLICATION APPROVED *
> ***********************
Part 2
Once you are sure that the program is making correct approval decisions extend it in the following way :
• check if all input data is valid
• after an application is processed, ask if there is another one and loop until there is none left.
at the end print the percentage of approved applications.
• make up your own example (it should include at least 3 passes through the loop, some approved and some non-approved applications).
ASSIGNMENT 7
Assignment #7
Grades 2
________________________________________
Problem Statement :
Write a program that will read student names and percentage grades frome the keyboard and then sort them (highest grade first) and calculate average, lowest and highest grade as shown below:
Example :
>How many students do you want to process?
4
>Enter name for student #1 :
JONES
>Enter grade for student #1 :
60
>Enter name for student #2 :
SMITH
>Enter grade for student #2 :
80
>Enter name for student #3
FORSTER:
>Enter grade for student #3 :
55
>Enter name for student #4 :
ALAZAR
>Enter grade for student #4 :
85
>====================
>CLASS GRADE REPORT :
>____________________
>ALAZAR B
>SMITH B
>JONES D
>FORSTER F
>_____________________
>HIGHEST GRADE : 80.00
>LOWEST GRADE : 55.00
>AVERAGE : 70.00
>=====================
ASSIGNMENT 8
________________________________________
Write a menu driven program that implements the following Binary Search Tree Operations
• FIND (item)
• INSERT (item)
• DELETE (item)
• DELETE_TREE (delete all nodes - be careful with the traversal!)
ASSIGNMENT 9
Write a program that finds the max binary tree height. (This is an extremely short piece of code!)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment