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
- BGN352: Building Law Assignment, UiTM, Malaysia English Law plays an important part in the Malaysian legal system and Explain the application of English Law as a source
- MGT4230: With the record-breaking high temperatures as well as massive floodings in various countries all around the world: Individual Assignment, IIU, Malaysia
- Principal of Economy Assignment, SU, Malaysia The presentation of the Budget 2023 by the Prime Minister of Malaysia. Various government initiatives for the welfare
- Engineering Mathematics Report, UTM, Malaysia Solve the following initial value problem by using the Taylor series method and improved Euler’s method Compare your results with the exact solution
- Anatomy & Physiology 2 Essay, IIUM, Malaysia Discuss the endocrine system and its components as well as the physiology of a Diabetes mellitus patient who develops
- BHM 3263: Pharmaceutical Management Essay, AMU, Malaysia You have to investigate the management of the pharmacy that you have chosen, by interviewing and researching
- CHE61504: Engineering Fluid Mechanics Assignment, TU, Malaysia Working as an aircraft engineer in the Ministry of Defense, you have been requested to design a modern combat aircraft
- Environmental Health Ethics Assignment, MU, Malaysia First-world countries like the USA, the United Kingdom, and other European nations have boasted high rates of recycling
- International Finance Assignment, MU, Malaysia Malaysia is the 19th largest export economy in the world and the 25th most complex economy according
- BNRE6113: Learning Skill Assignment, LUC, Malaysia Information technologies have affected every aspect of human activity and have a potential role to play in the field of education