Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a class Account and the driver class Account Demo. The class is based on a bank. 1. The attributes of Account class are


Design a class Account and the driver class Account Demo. The class is based on a bank. 1. The attributes of Account class are as follows: (1 pt) a. long id; // should be a default of -1 b. double balance; // should be a default of $5 c. double interestRate; // 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 closeAccount (2 pt) 5. Create a UML diagram for the Account class (4 pts) 6. Create AccountDemo (4 pts) a. Use the following values-id 1234, balance $4,321 and an interest rate of 3.2%. b. Use the withdraw method to withdraw $3,210 c. Use the deposit method to deposit $2,345 d. Print the id and balance. 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 Polygon Fun and Polygon FunDemo. 1. The attributes of PolygonFun class are as follows: (1pt) a. int sides; // should be a default of 3 b. double sideLength; // should be a default of 1 c. double xCoordinate; // should be a default of 0 d. double yCoordinate; // should be a default of 0 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. c. A polygon with user-specified number of sides, length of sides, xCoordinate and yCoordinate 3. Create the accessor and mutator methods for sides, sidelength, xCoordinate, yCoordinate (3 pts) 4. Create two additional methods getPerimeter() and getArea (3 pts) 5. Create the UML diagram for the class (2 pts) 6. Create PolygonFunDemo - use all three constructors (step 2) (3) area 4 tan ( N 180 where S is the length of any side N is the number of sides TAN is the tangent function calculated in degrees (see Trigonometry Overview)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting

Authors: Anne Britton, Chris Waterston

5th edition

273719300, 273719304, 978-0273719304

More Books

Students also viewed these Programming questions

Question

What is the difference between SIMD and SPMD?

Answered: 1 week ago