Question: Creating and Using Classes, Object-Oriented Thinking 1. Java classes can represent real-world 2. The in a class, along with their values, model the state of
Creating and Using Classes, Object-Oriented Thinking 1. Java classes can represent real-world 2. The in a class, along with their values, model the state of an object. 3. The in a class define the behavior of an object. Create a class named Student with the following data members and visibilities: -name: String -major: String -age: double gpa: double Create constructors for your Student class. Create a no-arg default constructor and at least one convenience constructor. 4. 5. 6. Create accessor (get) and mutator (set) methods for each data member. 7. Write a test script named StudentTest.java that creates an instance of Student and gives each data member values using mutator methods. Create a class named Course with the following data members and visibilities: -name: String -subject: String -number: int -credits: int 8. I/ex: Calculus I I/ ex: MATH Ilex: 1161 // ex: 4 . Create constructors for your Course class. Create a no-arg default constructor and at one convenience constructor. Create accessor (get) and mutator (set) methods for each data member. . Modify StudentTest.java so that it creates an instance of Course and fills in data mem values for each of that course using mutator methods. Think about the relationships that exist in the real world for these two types of obje What are some ways they can be related? Think of at least two natural relationshi involving a Student and a Course What are some ways we could implement these relationships in code using what w about classes and objects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
