Object Oriented Programming Assignment, UKM, Malaysia A student class has the following properties: Data Member Sample Data ID 2345, 4001 scores 56, 87, 0, 70 grade ‘A’, ‘B’. Methods public int getId()
| University | Universiti Kebangsaan Malaysia (UKM) |
| Subject | Object Oriented Programming |
QUESTION 1
A student class has the following properties: Data Member Sample Data ID 2345, 4001 scores 56, 87, 0, 70 grade ‘A’, ‘B’. Methods public int getId() return the id of student. The default id of the student is 0. public int getScore() return score of a student. The default score is 0. public void setId(int id) set the id of the student. public void setScore(int sc) set the score of a student. public void set grade(char G) set the grade of a student. public char check grade() check the grade based on the score table below Score Grade 76-100 A 60-75 B 45-59 C 35-44 D 20-34 E 0-19 F
1) Write a class definition for the Student class.
2) Write an application :
a) Write a statement to declare and create an object for a student
b) Input all the information.
c) Count the number of students who get E and F and store them in the variable numFail.
d) Loop the process using sentinel controlled loop e) Display numFail.
Recent Solved Questions
- BUSN11078: Integration of Business Functions Assignment, UWS, Malaysia Demonstrate a critical understanding of the key tools for analysis of the internal and external environmental
- MPU3412: Community service activities are aimed at improving people’s lives so that they can contribute: Community Service Assignment, OUM, Malaysia
- LAW498: Law of Torts II Assignment, UiTM, Malaysia Miza owns a house in the middle of a heavily agricultural area in Kampung Permatang. She lives with her husband
- Assessment 1: Design Thinking Enhancing Customer Experience at Trendy Threads: A Fashion Journey Taylor’s University (TU)
- Preventing Accident at Workplace Understanding with OSHA
- CBMS4303 Management Information System (Sistem Pengurusan Maklumat) Assignment – Semester September 2025
- EED308: Briefly explain the need for 21st century skills in today’s world: English Language Teaching In Malaysia Assignment, WOU, Malaysia
- DSC763: Customer Analytics Case Study, UiTM, Malaysia A telecommunication company, MAYS Private Limited, wants to improve its customer experience with services
- Wind Engineering Thesis, UTM, Malaysia There is an urgency for us to implement energy saving in buildings because of the high energy consumption and CO2 emission
- Freight and Supply Chain Management Research Paper, SU, Malaysia According to Ziesemer, Thomas (1995) in his study about the growth with imported capital goods