The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 364 Weeks Ago, 3 Days Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
1. Write a Circle class that has the following fields:
  -radius: a double
  -PI: a double (DO NOT include Pl as an attribute - use the constant from the Math class (check the Math API)
2. The class should have the following methods:
-Constructor. Â Accepts the radius of the circle as an argument
-Constructor.  A no-argument constructor that sets the radius field to 0.0
-setRadius. A mutator method for the radius field.
-getRadius. A accessor method for the radius field.
-getArea. Returns the area of the circle, which is calculates as area = PI * radius * radius.
-getDiameter. Returns the diameter of a circle, which is calculated as diameter = radius * 2.
-getCircumference. Returns the circumference of a circle, which is calculated as circumference = 2 * PI * radius
-toString(). Displays the current state of the object, include in the state the radius, diameter, area, and circumference of the circleÂ
(DO NOT create attributes for the diameter, area and circumference).
3. Write a RetailItemDriver class and include the following items:
-two Circle objects (this is read in from the retailItems.txt file)
-determineLargerCircle() - this method will display the larger of two circle objects (pass the circle objects into this method from main() )
-getACircle() - this method will read the radius of the circle from the data file (one by one), call this method twicefrom main() and return the circle object back to main()
-displayACircle() - this will display the current state of the circle object, including the radius, diameter, area, and circumference.
---
So I have attached the beginnings of my Java code for RetailItem & RetailItemDriver but I can't quite figure out how to implement the methods: displayACircle(), getACircle(), and determineLargerCircle(). Â I am also confused on how to "read" in data from the file.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I