Question: Part B - Sample Question: Given the following UML for the LandscapingService Class: LandscapingService - serviceLevel : char - acreage : double LandscapingService ( newServiceLevel

Part B - Sample Question:
Given the following UML for the LandscapingService Class:
LandscapingService
-serviceLevel : char
-acreage : double
LandscapingService ( newServiceLevel : char, newAcreage: double )
+getAcreage(): : double
+getServiceLevel():char
+setAcreage( newAcreage: double ): void
+setServiceLevel( newServiceLevel : char ) : void
+cost(): double
And given the logic for the calculation of cost()
A Landscaper has two Service Levels for landscaping: S=Standard and P=Pr remium. The Landscaper
looks at each lot maintained as a Landscaping Solution because of the complexities in landscaping.
The costs are calculated differently:
The cost of the Standard Service Level(S) is $9,865.34 per acre regardless of the size of the
lot.
Example: at the Standard Service Level, a 1.5 acre lot is $14,798.01=1.5*9,865.34
The cost of the Premium Service Level(P) is $15,975.75 for up to an acre. When a lot is over
an acre the price is $15,975.75 for the first acre and $21,999.98 per acre beyond 1.
Example: at the Premium Service Level, a 1.5 acre lot is $26,975.74=1.0*$15,975.75
+0.5*$21,999.98
You do not need to handle lowercase, but if the serviceLevel is neither S nor ) should return 0
On the Java Programming Answer Sheet, write the cost() method (30 points)
You are only writing the cost() method as if it was inside the LandscapingService class
Note: You are writing the code for the cost() method on paper. Try your best to write the method as
close to Java as possible, but don't worry if a ; is missing or a set of
 Part B - Sample Question: Given the following UML for the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!