Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

java hw - ignore add time i have it working and can use it in these othe rmethods i do not need help worh tbe

java hw - ignore add time i have it working and can use it in these othe rmethods
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
i do not need help worh tbe addTime method but cannot do the other ones.
the method outlined in greeb text must be created
the is before method needs to checm jf osn time js before other time. the is overlap needs to check if a exam overlaps with other exam. the logic in the current methods is incorrect.
zoom in on first and third snd fourth photos to read
made new post with code
J e n Holland > Desktop > 115>A> Lamjua x 282 Examjava > Beam > FILE is Overlaplexam) lave Overv 0 0 - 285 / toString Purpose: returns a String representing this Exam formated as date: location: startTime-endTime Parameters: nothing Returns: String - a representation of this Exam Example: Exam Exa(new Date("October", 25, 2019), ECS 125", e.toString() returns October 25, 2019: ECS 125: 9:30am-11:30 Time(9,30), 120) 195 197 298 HENT: Instructor made use of add method in the Time class Be careful how you use it as it is an instance method that updates the Instance data 200 201 202 // TODO public String tostring() Stringsdato . returns -.location start 205 BADILava o > Users > Jalen Holland > Desktop > CSC115 > A2 > Time java > Time /* addTime Purpose: updates the values of this Time's hour and minute by adding the given minutes. The updated time is a valid 24 hour clock Time * Parameters: int minutes * Precondition: minutes >= Example: Time t = new Time (23, 30); t.addTime(70) will change t's hour to @ and minute to 40 This is because 23:30 == 11:38pm, we add 70 minutes (1 hr, 10 minutes) => 12:40am - 8:40 on 24 hour clock RECALL 00:00 is 12:00am which is midnight // TODO public int addTime(int minutes) { this.minute += minutes; if (this.minute other.hour) return false; else if(minuteSother.minute) return false; else return true; 147 148 149 risoverlap Purpose: determines whether the date and time of this Exam overlaps with the other Exam date and time Parameters: Exam - other Precondition: other is not null Returns: boolean - true if this Exan overlaps with other, false otherwise 168 269 HINT: Instructor made use of addTime method in the Time class Be careful how you use it as it is an instance method that updates the instance data 170 171 172 173 174 public boolean Isoverlap(Exam other) 1+((date - other.data) start Time - return false; other.startTime return true O Type here to search J e n Holland > Desktop > 115>A> Lamjua x 282 Examjava > Beam > FILE is Overlaplexam) lave Overv 0 0 - 285 / toString Purpose: returns a String representing this Exam formated as date: location: startTime-endTime Parameters: nothing Returns: String - a representation of this Exam Example: Exam Exa(new Date("October", 25, 2019), ECS 125", e.toString() returns October 25, 2019: ECS 125: 9:30am-11:30 Time(9,30), 120) 195 197 298 HENT: Instructor made use of add method in the Time class Be careful how you use it as it is an instance method that updates the Instance data 200 201 202 // TODO public String tostring() Stringsdato . returns -.location start 205 BADILava o > Users > Jalen Holland > Desktop > CSC115 > A2 > Time java > Time /* addTime Purpose: updates the values of this Time's hour and minute by adding the given minutes. The updated time is a valid 24 hour clock Time * Parameters: int minutes * Precondition: minutes >= Example: Time t = new Time (23, 30); t.addTime(70) will change t's hour to @ and minute to 40 This is because 23:30 == 11:38pm, we add 70 minutes (1 hr, 10 minutes) => 12:40am - 8:40 on 24 hour clock RECALL 00:00 is 12:00am which is midnight // TODO public int addTime(int minutes) { this.minute += minutes; if (this.minute other.hour) return false; else if(minuteSother.minute) return false; else return true; 147 148 149 risoverlap Purpose: determines whether the date and time of this Exam overlaps with the other Exam date and time Parameters: Exam - other Precondition: other is not null Returns: boolean - true if this Exan overlaps with other, false otherwise 168 269 HINT: Instructor made use of addTime method in the Time class Be careful how you use it as it is an instance method that updates the instance data 170 171 172 173 174 public boolean Isoverlap(Exam other) 1+((date - other.data) start Time - return false; other.startTime return true O Type here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students explore these related Databases questions