Answered step by step
Verified Expert Solution
Question
1 Approved Answer
project folder named Midterm which will accomplish the tasks that follow in the next sections. Once complete, navigate to your eclipse - workspace folder, send
project folder named Midterm which will accomplish the tasks that follow in the next sections. Once
complete, navigate to your eclipseworkspace folder, send the Midterm project folder to a compressed
zipped folder, then upload and submit that compressed zipped folder to the Midterm project link in
Canvas.
Create the class named SodPurchase
Define a final and static tax rate class constant set to
Instance data fields data attributes that must be included use meaningful data field identifiers:
Customer ID int
Customer Name String
Sod Type String
Length double
Width double
Sod Price per Square Foot double
Write one constructor that receives and sets all instance data fields passed as arguments during
instantiation of objects; use this reference appropriately
Nonstatic methods that must be included use meaningful method identifiers:
A method to calculate the area does not receive parameters: uses the length and the width to
calculate the square footage of a rectangular area, and returns the area square footage to
driver program
A method to calculate the subtotal receives the area square footage as a parameter from
driver program: calculates the subtotal using the price and the square footage, and returns the
subtotal to driver program
A method to calculate the grand total receives the subtotal as a parameter from the driver
program: calculates the grand total using the subtotal and the tax rate constant, and returns the
grand total to the driver program
A method to display the sod purchase details receives area square footage subtotal and grand
total as parameters from driver program; prints customer ID customer name, sod ID area
square footage subtotal and grand total formatted as displayed in Expected Output; even
though technically unnecessary, use getters to display any instance data fields
Create getters and setters for each instance data field, even though setters will not be used Create the application class driver program named SodEmporium
Instantiatecreate new SodPurchase objects which use the programmer written constructor
passing as arguments, the constant data found in the table below hardcode data arguments:
For each object, do the following:
Call the method that calculates the area square footage from this driver program; save the
returned area in a variable
Call the method that calculates the subtotal passing the saved area as an argument; save the
returned subtotal in a variable
Call the method that calculates the grand total passing the saved subtotal as an argument; save
the returned grand total in a variable
Call the method that displays the details passing the saved area, subtotal, and grand total as
arguments
Be sure you do not to wrap or nest methods calls
Expected Output
The output to be displayed on the console appears in the image below:Submissions
Upload and submit the zipped Eclipse Midterm folder to Canvas.
Grading Rubric
Meet the above requirements plus also see more detailed Rubric in Canvas:
Use meaningful and proper variablemethodobject names
Define constant properly
Format dollar amounts to decimal places, inserting comma separators
No unnecessary code
No extra data fields defined, use local variables to hold calculated values in methods
Proper documentation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started