Question: java Objectives: In this lab we are going to practice how to write our own class with some methods and use it in our main
Objectives: In this lab we are going to practice how to write our own class with some methods and use it in our main program. Write a java program that fulfil the following: 1- Define a class named (Course) 2- Define 3 privet attributes (string Course_name, int Course_number, double credit) 3- Define 2 constructors one with no parameters (set the values to zero and the name to unknown) and parametrized constructor use the input parameters. 4- Write 3 set methods (one for each attributes). 5- Write 3 get methods (one for each attributes). 6- Write public method to print the object state. 7- Write a main method that: a. Define an object (call parametrized constructor) b. Call print method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
