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
- Ahmad is attempting to perform an inventory analysis on one of his most popular products: Production Operation Management Home Work, UUM, Malaysia
- FEEP LTO ODL the Role of AI in People Management: Insights from an HR Practitioner in Malaysia
- A company, Photo Haven currently orders 15,000 hinges per month from E-Mach Manufacturing at MYR3.00 each: Business Mathematics Assignment, HU, Malaysia
- ADS404: Introduction to Public Administration Assignment, UiTM, Malaysia All the country in the world has their own system to govern their state such as democratic, communist, totalitarian
- Programming Fundamental Assignment, TU, Malaysia Morgan Stark is a child prodigy just like his father Tony Stark when he was young. At five years old, she self-taught herself
- Master of Industrial and Organizational Psychology Dissertation, UMS, Malaysia Many organizations face challenges to motivate and foster commitment among their employees due
- Identify a conflict on the theme of change that is explored in the novel: Malaysian Popular Literature and Culture Assignment, UNM, Malaysia
- Business English Report, UBir, Malaysia Identify an issue at your company that needs to be solved. The issue can revolve around
- Fundamental of Integrated Marketing Communication Case Study, UUM, Malaysia With an average annual growth rate of 11.2% over the past twelve years, tourism has been integral to the economy
- Marketing Strategy Assignment, ASB, Malaysia Pick an industry and classify firms according to the 4 different roles they might play: leader, challenger, follower