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
- GLUP5024 Infographic Poster: Exploring Topics 7 & 8 with Latest Case Studies (2018-2024)
- NWC4123: WebGoat is a deliberately insecure web application maintained by OWASP designed: Ethical Hacking Assignment, UPTM, Malaysia
- EAC6013 Academic Writing Assignment Saito University College
- A241 SQQSK101 Elementary Statistics Group Assignment
- AC4012: Introduction to Financial Accounting Report, SC, Malaysia You are required to choose TWO listed companies from Bursa Malaysia with the annual report from 2014 onwards
- BCS2143: Object Oriented Programming Assignment, UMP, Malaysia You are required to develop a Java Application-based banking application that enables customers to apply for loans online
- TEE103: i. Calculate the voltage Vs, by using Kirchhoff’s law and Ohm’s.: Circuit Theory I Assignment, WOU, Malaysia
- NBHS1213: Anatomy and Physiology 2 Assignment, OUM, Malaysia Discuss the urinary system and its components from the perspective of anatomy and physiology
- HPGD1103: Identify and describe 2-3 recent advances or trends in curriculum development that are relevant to 21st century: Curriculum Development Assignment, Malaysia
- English for Workplace communication, OUM, Malaysia The increase in mobile phone use has transformed the way we live, communicate and do business