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
- FIT2004: Algorithms and data structures Assignment, MUM, Malaysia you need to create a program the user can enter a word, reverse the word and check if the word is a palindrome word using a linked list
- CHE61504: Engineering Fluid Mechanics Assignment, TU, Malaysia Create the dimensionless relationship and design of the airport wind anemometer
- FFN20303: How much would you have had to invest 21 years ago (t) in an account paying 6%(r) compounded: Money And Capital Market Assignment, MSU, Malaysia
- Capital Budgeting Assignment : PIONG Corporation Case Study for NPV, IRR & Risk Analysis
- A241 SQQSK101 Elementary Statistics Group Assignment
- ADS560: SESI-MAR-2024: Case Study, UITM, Malaysia
- Assessment 1: Design Thinking Enhancing Customer Experience at Trendy Threads: A Fashion Journey Taylor’s University (TU)
- The management team of a company decided to undertake organisational change management strategies: Organizational development and change management Case Study, UIU, Malaysia
- Master of Renewable Energy Assignment, UM, Malaysia Malaysia has used renewable energy technology such as biomass, solar and hydro energy for power generation
- International Finance Assignment, SC, Malaysia The British Pound Sterling (GBP) is the fourth most popularly traded currency and the third most commonly held reserve currency