Question: in java CSC 170L-A/B/C Introduction to Object-Oriented Programming (Java) Labs Big Lab #2 (Due at 11:59 PM, Monday, February 01, 2021) The goal of this


CSC 170L-A/B/C Introduction to Object-Oriented Programming (Java) Labs Big Lab #2 (Due at 11:59 PM, Monday, February 01, 2021) The goal of this lab is to learn the followings: Learn more about classes, objects, instance variables, constructors, methods. getters accessors), and setters (mutators) Use Testbenches Phase 1 - Modifying the Student class Add the following private instance variables. Variable name Data type email String major String degreeType String (BS, BA) current Year String (freshman, sophomore, junior, senior) current Semester int completedCreditHours double Generate setters and getters for the instance variables. Add the following methods. contact(): Display name and email instance variables. studyArea(): Display major and degree Type instance variables. semesters ToGraduate(int degreeLength): This method takes the current length of a degree in terms of the number of semesters to complete and retums the remaining number of semesters for the student to graduate. That is (degreeLength - CurrentSemester). For example, assume that BA with Computer Science Major takes 8 semesters to complete and the student's currentSemester is 5. So this method returns 3. remaining CreditHours(double required CreditHours): This method takes the total credit hours required for a degree and returns the remaining credit hours to complete for the student to graduate. That is required CreditHours completed CreditHours) CSC 170L-A/B/C Introduction to Object-Oriented Programming (Java) Labs Add the following constructors. public Student(): Initialize all the instance variables to default values. All the string variables to the empty string, int variables to 0, and double variables to 0.0 public Student(String name, int age): Takes the name and age as parameters and set the instance variables. public Student(String name, int age, String email, String major): Takes the name, age, email, and the major as parameters and set the instance variables Convert the Main Driver class into a Testbench for verifying that the Student class is working correctly. Phase 2 - Modifying the Cat class . Add the following private instance variables. Variable name Data type height double weight double color String mood int (in a scale of 1-10) hungry int in a scale of 1-10) energy int (in a scale of 1-10) purr volume double Cat's purrs are recorded between 0.0 and 67.8 decibels www.guinnessworldrecords.com/world- Generate setters and getters for the instance variables. . Add the following methods. meow() - Display the word "meow play() - mood increase by 1, energy decrease by 1, call the meowi) method once sleep) -energy increase by 1, hungry increase by 2 feed() - mood increase by 2, hungry decrease by 3, call the meow() method once 2 CSC 170L-A/B/C Introduction to Object-Oriented Programming (Java) Labs Add the following constructors. public Cat(): Initialize all the instance variables to default values. All the string variables to the empty string, int variables to 0, double variables to 0.0, and the boolean variables to false. public Cat(String name, int age): Takes the name and age as parameters and set the instance variables public Cat(String name, int age, double height, double weight, String color, boolean declawed): Takes the name, age, height weight, color and declawed as parameters and set the instance variables. Add a testbench in MainDriver class to verify that the Cat class is working correctly. Phase 3 - Add JavaDoc comments for all your classes, instance variables, constructors, and methods. Add regular comments to describe any other important statements. Generate the JavaDoc for your project Submission. Zip file from your project folder and submit via Moodle Biglab 1 link Grading Breakdown: Student java (10 points) Cat.java (20 points) Main class code (testbenches) (30 points) JavaDoc of Student (20 points) JavaDoc of Cat (20 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
