- Short Assignment 501 Objectives Understand The Basic Concept About Oop Working With Control Flows If For Do Whil 1 (138.39 KiB) Viewed 82 times
Short Assignment 501 Objectives: Understand the basic concept about OOP. • Working with control flows: if, for, do..whil
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Short Assignment 501 Objectives: Understand the basic concept about OOP. • Working with control flows: if, for, do..whil
Short Assignment 501 Objectives: Understand the basic concept about OOP. • Working with control flows: if, for, do..while, while. Assignment Specifications: Create a class to represent a Course type in java, which should have the following: Instance variables: course code: course id, String type course name: course name, String type • duration: course duration, double type status: status course, String type • flag: mark the course is optional or required, String type Constructor: • No-argument constructor: set all attributes with a default value of 0.0 or null. • Constructor: that accepts 5 arguments for attributes. Instance methods: • Getter/setter methods. • Overriding toString() method to print student detail. • public void input(): This method to enter values for Course from information from the keyboard. Create a new class named CourseManagement with a main() method. Business Rules: • course code: is a string of 5 characters, started by "FW" and followed by 3 digits. • status: only accept 'active' or 'in-active'. • flag: only accept 'optional', 'mandatory', 'N/A. Problem Descriptions: Requirement: write a java console program. 1. Create an array of 10 courses and input data from the keyboard. Invalid values require repeat re-input until the correct value. 2. Search courses by one of the attributes (method named: find(String type, Object data). In which, the type: attribute name, the data: data for search. 3. Display all courses that flag is "mandatory".