Question

CSIT 210 n/bbcswebdav/pid-8544435-dt-content-rid-37523491_1 /courses/CSI T2 10.2 1 662.20192 1/Lab%206.pdf bat. Import bookma

rks now. PolygonFun Class (20 pts) A polygon is a unique shape, where all the sides have both the same length as well as angl

this program is in java (eclipse).

CSIT 210 n/bbcswebdav/pid-8544435-dt-content-rid-37523491_1 /courses/CSI T2 10.2 1 662.20192 1/Lab%206.pdf bat. Import bookmarks now Lab 6: Module 5- Classes Account Class (15 pts) Design a class Account and the driver class AccountDemo. The class is based on a bank. 1. The attributes of Account class are as follows: (1 pt) a. long id;I should be a default of -1 b. double balance; I/ should be a default of $5 c. double interestRate; W should be a default of 0 2. Create two constructors- one with no arguments and the second with the id and balance (2pt) 3. Create the accessor and mutator methods for id, balance and interestRate (2pt) 4. Create three methods withdraw, deposit and closeAcount (2 pt) 5. Create a UML diagram for the Account class (4 pts) 6. Create AccountDemo (4 pts) a. b. c. d. Use the following values-id 1234, balance S4321 and an interest rate of 3.2%. Use the withdraw method to withdraw $3,210 Use the deposit method to deposit $2.345 Print the id and balance. PolygonFun Class (20 pts) A polygon is a unique shape, where all the sides have both the same length as well as angles. create a class named PolygonFun and PolygonFunDemo. We are going to 1. The attributes of PolygonFun class are as follows: (2pt) a. int sides; Il should be a default of3 b. double sideLength; should be a default of 1 c. double xCoordinate; I/ should be a default of d. double yCoordinate; I/ should be a default of 0 2. Create three constructors- (3 pts) a. A polygon with default values b. A polygon with a user-secified number of sides and length of sides with the xCoordinate and yCoordinate set to 0. A polygon with user-specified number of sides, length of sides, xCoordinate and yCoordinate c. 3. Create the accessor and mutator methods for sides, side Length, xCoordinate, yCoordinate (3 pts) 4. Create two additional methods getPerimeter) and getArea (5 pts) 5. Create the UML diagram for the class (4 pts)
rks now. PolygonFun Class (20 pts) A polygon is a unique shape, where all the sides have both the same length as well as angles. We are going to create a class named PolygonFun and PolygonFunDemo. 1. The attributes of PolygonFun class are as follows: (2pt) a. int sides; I should be a default of 3 b. double sideLength; II should be a default of 1 c. double xCoordinate; I/ should be a default of 0 d. double yCoordinate; // should be a default of0 2. Create three constructors-(3 pts) a. A polygon with default values b. A polygon with a user-specified number of sides and length of sides with the xCoordinate and yCoordinate set to 0. A polygon with user-specified number of sides, length of sides, xCoordinate and yCoordinate c. 3. Create the accessor and mutator methods for sides, sideLength, xCoordinate, yCoordinate (3 pts) 4. Create two additional methods getPerimeter) and getArea (5 pts) 5. Create the UML diagram for the class (4 pts) 6. Create PolygonFunDemo - use all three constructors (step 2) (3 pts) where S is the length of any side N is the number of sides TAN is lhe tangent function calculated in degrees (soe Trigoncmetry Ovarview area- ip
0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Study smarter, not harder.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • (Geometry: n-sided regular polygon) An n-sided regular polygon’s sides all have the same length and all...

    (Geometry: n-sided regular polygon) An n-sided regular polygon’s sides all have the same length and all of its angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon that contains: ■ A private int data field named n that defines the number of sides in the polygon. ■ A private float data field named side that stores the length of the side. ■ A private float data field named x that defines...

  • Problem 2 9.9 Geometry: n-sided regular polygon pg. 362 (25 points) Follow instructions as provided on...

    Problem 2 9.9 Geometry: n-sided regular polygon pg. 362 (25 points) Follow instructions as provided on page 362, reprinted below 9.9 (Geometry: n-sided regular polygon) In an n-sided regular polygon, all sides have the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular) Design a class named RegularPolygon that contains A private int data field named n that defines the number of sides in the polygon with default value of 3 A...

  • Write a simple class representing a Polygon up to 6 sides: the Polygon class has 5...

    Write a simple class representing a Polygon up to 6 sides: the Polygon class has 5 fields: Regular, sides, sideLength, angle, apothem Polygon: Regular: boolean sides: int sideLength: double angle : double apothem : double Provide a no-arg constructor for this class initializes the object and sets the instance variables to: Regular: true sides: 3 sideLength: 1 angle : 60 apothem : SquareRoot(3)/2 Provide the following methods: Set number of sides set the length of the sides set the angle...

  • //include comments Opts (Regular polygon) An n-sided regular polygon has n sides of the same length...

    //include comments Opts (Regular polygon) An n-sided regular polygon has n sides of the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon that contains: Aprivate int data field named n that defines the number of sides in the polygon with default value 3. A private double data field named side that stores the length of the side with default value 1. A private double data field...

  • Create a UML diagram with 3 lines per class/interface including all constructors. public class Point {...

    Create a UML diagram with 3 lines per class/interface including all constructors. public class Point { public double X, Y; public Point() { this(0, 0); } public Point(double newX, double newY) { X = newX; Y = newY; } public static double distance(Point A, Point B) { return Math.sqrt(Math.pow(A.X-B.X, 2) + Math.pow(A.Y-B.Y, 2)); } } public interface Polygon { public int getNumberOfSides();    public double getPerimeter();    public double getArea();    } public abstract class Simple_polygon implements Polygon{ public Point...

  • (The Account class) Design a class named Account that contains: A private int data field named...

    (The Account class) Design a class named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. A private Date data field named dateCreated that stores the date when the account was created. A no-arg constructor that creates a default...

  • New to python if you can add screenshort also, i am using python 3 7.3 (The...

    New to python if you can add screenshort also, i am using python 3 7.3 (The Account class) Design a class named Account that contains A private int data field named id for the account. A private float data field named annualInterestRate that stores the current A constructor that creates an account with the specified id (default 0), initial The accessor and mutator methods for id, balance, and annualInterestRate A private float data field named balance for the account. interest...

  • Create the Python code for a program adhering to the following specifications. Write an Employee class...

    Create the Python code for a program adhering to the following specifications. Write an Employee class that keeps data attributes for the following pieces of information: - Employee Name (a string) - Employee Number (a string) Make sure to create all the accessor, mutator, and __str__ methods for the object. Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: - Shift number (an integer,...

  • You will need to first create an object class encapsulating a Trivia Game which INHERITS from...

    You will need to first create an object class encapsulating a Trivia Game which INHERITS from Game. Game is the parent class with the following attributes: description - which is a string write the constructor, accessor, mutator and toString methods. Trivia is the subclass of Game with the additional attributes: 1. trivia game id - integer 2. ultimate prize money - double 3. number of questions that must be answered to win - integer. 4. write the accessor, mutator, constructor,...

  • Java Program Please help me with this. It should be pretty basic and easy but I...

    Java Program Please help me with this. It should be pretty basic and easy but I am struggling with it. Thank you Create a superclass called VacationInstance Variables destination - String budget - double Constructors - default and parameterized to set all instance variables Access and mutator methods budgetBalance method - returns the amount the vacation is under or over budget. Under budget is a positive number and over budget is a negative number. This method will be overwritten in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT