add fields to store the start,end, description and level using the types indicated in the class diagram add static fields to store the points and the numWorkOuts using the types indicated in the class diagram add constant static fields to set LOW to 4 and MEDIUM to 8 code a parametised contructor to assign values to the fields points and numWorkOuts code a second parametised constructor to assign values to the description and level fields add code to instantiate the start DateTime field using the string parameter s. The date and time will be in the format: 2021/06/06 17:34:35. repeat the process for the end DateTime field using the parameter e. increase the filed numWorkOuts by 1. increase the points field by caluclating the points using the formula below and then adding this value to the existing points field. points=(level*number of minutes)/20 round the points field to one decimal place. 1.7 add accessor methods for the points and numWorkOuts fields. 1.8 add a method called getMinutes to calculate the number of minutes between the start and end fields. 1.9 add a method called getStars to determine the number of starts based
class diagram information on the picture
INSTRUCTION
write a java programme
- create a class called WorkOut.
- add fields to store the start,end, description and level using the types indicated in the class diagram
- add static fields to store the points and the numWorkOuts using the types indicated in the class diagram
- add constant static fields to set LOW to 4 and MEDIUM to 8
- code a parametised contructor to assign values to the fields points and numWorkOuts
- code a second parametised constructor to assign values to the description and level fields
- add code to instantiate the start DateTime field using the string parameter s. The date and time will be in the format: 2021/06/06 17:34:35.
- repeat the process for the end DateTime field using the parameter e.
- increase the filed numWorkOuts by 1.
- increase the points field by caluclating the points using the formula below and then adding this value to the existing points field. points=(level*number of minutes)/20
- round the points field to one decimal place.
1.7 add accessor methods for the points and numWorkOuts fields.
1.8 add a method called getMinutes to calculate the number of minutes between the start and end fields.
1.9 add a method called getStars to determine the number of starts based on the number of work outs.Use the tablebelow to return the correct value using the numWorkOuts field.Use the fields LOW and MEDIUM to categorise the stars value.
1.10 add a method called changeDescription to change each description to a shortened code according to the following rules
- change the description to capital letters.
- keep the first letter of the description
- remove all other vowels.
1.11 add a toString method to display the date using the month name,start time,end time,description as a code,the level and the points earned as an increasing total.
sampleoutput: Date 03 Jun 2021 from 10:33:55 to 11:15:40 Description :SWMMN Level:2 Points Earned 3.9
Step by step
Solved in 3 steps with 1 images