0% found this document useful (0 votes)
73 views1 page

Prog Tutorial0 PDF

This document provides instructions for an object-oriented programming tutorial assignment. Students are asked to create classes to model a university course, including: a Course class to store a course name and code; a Lecturer class to store a lecturer's position and name; a Student class to store a student's name, ID, mark, and grade; and a Core class to contain objects of the other classes. The main function will prompt the user to enter student names and IDs, randomly assign marks, and display a gradebook with the course information, lecturer details, and each student's name, ID, mark, and grade. The number of students is specified as 10 but can be made variable using a const variable.

Uploaded by

Mazen Jamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views1 page

Prog Tutorial0 PDF

This document provides instructions for an object-oriented programming tutorial assignment. Students are asked to create classes to model a university course, including: a Course class to store a course name and code; a Lecturer class to store a lecturer's position and name; a Student class to store a student's name, ID, mark, and grade; and a Core class to contain objects of the other classes. The main function will prompt the user to enter student names and IDs, randomly assign marks, and display a gradebook with the course information, lecturer details, and each student's name, ID, mark, and grade. The number of students is specified as 10 but can be made variable using a const variable.

Uploaded by

Mazen Jamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

KIE1008 (Programming Tutorial) Session 2016/2017 (Semester 2)

Tutorial 0: Object-Oriented Programming (Classes Revision & Composition)

Write a program to record the information about courses offered by a university.

Create class course that records the course’s name and code. Create the appropriate accessor and
mutator functions. Also, create a friend function that display the course info.

Create class lecturer that records a lecturer’s position (Professor/Associate Professor/Senior


Lecturer/Lecturer) and name. Create the appropriate accessor, mutator and utilization functions.

Create class student that records a student’s name, ID, mark and grade. Create the appropriate
accessor, mutator and utilization functions.

Create a class called core that contains course, lecturer and an array of 10 students as private
data. Create the appropriate accessor, mutator and utilization functions.

Create main() that declares a core course, then prompt the user to key in the students’ info (name and
ID).

Enter Student 1’s name:


Enter Student 1’s ID:
Enter Student 2’s name:
Enter Student 2’s ID:

Write a function to randomly assign marks (0-100) for the students, and the grade is then calculated
automatically.

Lastly, display the info as follows:

Gradebook for KIE1008: Programming II


Lecturer: Chow Chee Onn (Position: Associate Professor)
1. John Lee (KIX160001) 70 (B)
2. Mohd. Amin (KIX160002) 80 (A)
3. Siti Rohani (KIX160003) 90 (A+)

Note: the first line is printed using the friend function, second line is printed by function inside class
lecturer, and each student info is printed by function inside class student.

Some of the design criteria are not given, use your creativity to design the program.

Extra: Let’s say the number of students is not fixed at 10, use a const variable to keep track of the
number of students.

---END---

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy