Design a class Account and the driver class Account Demo. The class is based on a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Name each acid. a. HF(aq) b. HNO3(aq) c. H2C2O4(aq)
-
The charge entering a certain element is shown in Fig. 1.23. Find the current at: (a) t = 1 ms (b) t = 6 ms (c) t = 10 ms 80 0 24 8 10 12 ms)
-
Consider an MCC with six identical motors, each motor rated at 60 HP, three-phase, 60 Hz, 460 V, 1760 RPM, a service factor of 1.00, and a power factor of 90%. All the motors are protected by...
-
What does the early evidence on the ability of behavioral investing to enhance performance tell us?
-
Tulsa Bookstore is the bookstore on campus for students and faculty. The bookstore shows the following sales projections in units by quarter for the upcoming year: (Click the icon to view the unit...
-
How do social movements and collective action challenge dominant narratives surrounding social class, and what strategies have been effective in mobilizing marginalized communities to advocate for...
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. The words For deposit only constitute a blank indorsement.
-
A party who would benefi t from the performance of a contract, but for whom the contract is not created. a. assignee b. assignment c. assignor d. bankrupt e. delegation f. guarantor g. incidental...
-
The person to whom real property is conveyed. a. accession b. adverse pos session c. in causa mortis d. eminent doma in e. fee s imple f. freehold e state g. grantee h. inter vivos i. joint te nancy...
-
Indicate whether each of the following statements is true or false by writing T or F i n t he a nswer c olumn. Most countries recognize U.S. patents but not copyrights.
-
The transfer of duties to a third party by a party to a contract. a. assignee b. assignment c. assignor d. bankrupt e. delegation f. guarantor g. incidental benefi ciary h. novation i....
-
In 2014 the voters of Solis City authorized the construction of a new swimming pool for a total cost of no more that $4 million. The voters also approved the issuance of $4 million of 20-year, 5%...
-
Briefly describe the following types of group life insurance plans: a. Group term life insurance b. Group accidental death and dismemberment insurance (AD&D) c. Group universal life insurance d....
-
Comment on this statement: Dynamic modeling is about interaction.
-
Explain how objects interact by exchanging messages.
-
Describe the relationship between dynamic modeling, behavioral modeling, and structural modeling.
Study smarter with the SolutionInn App