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
- MGF1010: Introduction to Management Assignment, MU, Malaysia Choose an organisation which you would like to render support in promoting workplace well-being
- Unit 2 Assignment – Strategic Supply Chain and Logistics Management
- HRM3183: Omega, Inc., is a small manufacturing company whose sales success or failure rests in the hands: Performance Management Case Study, UPTM, Malaysia
- BBNG3103: What is the meaning of foreign direct investment (FDI)? Give examples of FDI that are related to Malaysia: International Business Assignment, OUM, Malaysia
- Human Physiology Case Study, OUM, Malaysia: A 55-year-old woman reports intense thirst and recurrent vaginal thrush infections
- LAW511: Postmodernism re-opens and unsettles the legal concepts which had been previously thought: JURISPRUDENCE II Assignment, UiTM, Malaysia
- BNBS 6114: Communication and Counselling Essay, LUC, Malaysia Communication is vital in improving health outcomes. Due to the new challenges posed by the COVID-19 pandemic
- Business Ethics Essay, CU, Malaysia Having seen arguments concerning the various morally controversial issues, and the applications of the different ethical theories to them
- Accounting Assignment, MUM, Malaysia Discuss the Threats and Internal control procedures to prevent these threats by implementing Accounting Information System
- Theories and Contemporary Models in Visual Art Education Assignment, BCU, Malaysia Learning is a relatively continuing product of experiences that come out as a result of the interaction between the individua