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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

class diagram information on the picture

INSTRUCTION

write a java programme

  1.  create a class called WorkOut.
  2. add fields to store the start,end, description and level using the types indicated in the class diagram
  3. add static fields to store the points and the numWorkOuts using the types indicated in the class diagram
  4. add constant static fields to set LOW to 4 and MEDIUM to 8
  5. code a parametised contructor to assign values to the fields points and numWorkOuts
  6. 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

The details of each work out must be stored in a class called WorkOut object shown in the
class diagram. Use the class diagram to code the WorkOut object.
WorkOut
start: DateTime
- end : DateTime
- description : string
-
level : integer
points: real
-
numWorkOuts: integer
+ LOW: integer = 4
+ MEDIUM : integer =8
+ Constructor (p: real, n:integer)
+ Constructor (s:string, e:string, d:string, 1:integer)
+ get Points () : real
+ getNumWorkOuts (): integer
long getMinutes ()
+ int getStars ()
+ changeDescription ()
+ toString(): string
Transcribed Image Text:The details of each work out must be stored in a class called WorkOut object shown in the class diagram. Use the class diagram to code the WorkOut object. WorkOut start: DateTime - end : DateTime - description : string - level : integer points: real - numWorkOuts: integer + LOW: integer = 4 + MEDIUM : integer =8 + Constructor (p: real, n:integer) + Constructor (s:string, e:string, d:string, 1:integer) + get Points () : real + getNumWorkOuts (): integer long getMinutes () + int getStars () + changeDescription () + toString(): string
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY