合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

        program代做、Java程序語言代寫

        時間:2024-02-01  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



        Interfaces & Abstract Classes
        Bank Account
        1.2  What to do
        For this lab, you will design and implement the start of a banking solution for a neighborhood bank. There are two types of accounts the bank wants you to implement: one called SavingsAccount and one called CheckingAccount. Your interface and all classes must be in the bank package.
        Both accounts can do the following:
        **3;Create a new account by specifying a “starter” amount of money to open it with. The starter amount must be greater than or equal to one cent.
        Do this: Create a constructor that takes a single parameter (of type double) that represents the “starter amount” for the account. If the amount specified is negative OR the amount is less than one cent ($0.01), throw an IllegalArgumentException
        **3;Deposit into their account.
        Do this: Create a method called deposit that takes a single parameter (of type double) that represents the amount deposited into the account. If the amount specified is negative, throw an IllegalArgumentException
        **3;Withdraw from their account. If the amount specified is greater than the balance available, this operation fails and returns false.
        Do this: Create a method called withdraw that reduces the account balance by the amount specified. Return true if the transaction is successful, false otherwise. (Hint:  test for a variety of cases here, i.e. values > 0, 0 ...etc, what other cases may cause the withdraw transaction to fail)
        Check their balance. 
        Do this: Create a method getBalance that returns a double (the current account balance)
        Non-customer behavior you must implement:
        Bank administrators can perform monthly maintenance to assess monthly fees and give a “clean slate” for the subsequent month.
        Do this: Create a performMonthlyMaintenance method to charge any fees and then reset transaction counters to zero.
        Do this: Create a toString method that prints the account balance in dollars/cents format (e.g: $10.00). You may want to look up the documentation for the String.format method for this part, or use the DecimalFormat class if you wish.
         
        You are required to use the IAccount interface as specified below.  Both types of accounts implement this interface, so that the bank can access either account through that common protocol. You will need to consider behavior variations as described below.
        Behavior variations for a SavingsAccount withdraw() method: Savings accounts allow for 6 penalty-free withdrawal transactions per month. Savings accounts allow for an unlimited number of deposits per month.
        Rules:
        If the amount specified for the withdrawal is negative, the operation fails. If the number of withdrawals for the month is greater than 6, a transaction penalty of $14 is deducted from the account when monthly maintenance is performed
        Behavior variations for a CheckingAccount performMonthlyMaintenance() method: A minimum balance of $100 must be maintained throughout the month to avoid fees
        Rules:
        If the checking balance falls below $100 at ANY time during the month (before maintenance is performed) an account maintenance fee of $5 is charged when the monthly maintenance is performed.
        Notes
        For each method you write:
        Design the signature of the method.
        Write Javadoc-style comments for that method.
        Write the body for the method.
        Write one or more tests that check that the method works as specified in all cases.
        Avoid duplicating code as much as possible. You will likely want to use an abstract superclass and “push” common method code up to that class. Feel free to create private “helper” methods if you need to.
        Be sure to use access modifiers, private, default (no keyword), protected, and public appropriately.
        Include JavaDoc for your classes and constructors as appropriate. You do not need to repeat JavaDoc already existing in a superclass or interface when you override a method. (This is true for the course in general.)
        Provide a UML class diagram for your solution.
        Here is the IAccount interface. This is the "contract" your solution is agreeing to implement
        /**
         * This interface represents a bank account. It is the super-type for
         * any other type of traditional financial account a bank might offer
         */

        public interface IAccount {
          void deposit(double amount);
          boolean withdraw(double amount);
          double getBalance();
          void performMonthlyMaintenance();
        }
        如有需要,請加QQ:99515681 或WX:codehelp

        掃一掃在手機打開當前頁
      1. 上一篇:COSC2276代做、C/C++語言程序代寫
      2. 下一篇:代做CSCI203、代寫Python/c++編程語言
      3. 無相關信息
        合肥生活資訊

        合肥圖文信息
        出評 開團工具
        出評 開團工具
        挖掘機濾芯提升發動機性能
        挖掘機濾芯提升發動機性能
        戴納斯帝壁掛爐全國售后服務電話24小時官網400(全國服務熱線)
        戴納斯帝壁掛爐全國售后服務電話24小時官網
        菲斯曼壁掛爐全國統一400售后維修服務電話24小時服務熱線
        菲斯曼壁掛爐全國統一400售后維修服務電話2
        美的熱水器售后服務技術咨詢電話全國24小時客服熱線
        美的熱水器售后服務技術咨詢電話全國24小時
        海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
        海信羅馬假日洗衣機亮相AWE 復古美學與現代
        合肥機場巴士4號線
        合肥機場巴士4號線
        合肥機場巴士3號線
        合肥機場巴士3號線
      4. 短信驗證碼 酒店vi設計

        思思久久96热在精品国产| 亚洲中文字幕久久精品无码2021| 日韩伦理一区二区| 国产精品熟女视频一区二区| 五月天精品视频在线观看| 国产精品视频第一页| 91大神精品视频| 99久久国产综合精品swag| 久久午夜精品视频| 国产精品特级毛片一区二区三区 | 青青草97国产精品免费观看| 四虎成人精品在永久在线观看 | 国产在线精品一区二区三区不卡 | 国产亚洲精品xxx| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 97精品久久天干天天蜜| 久久99视频精品| 久热青青青在线视频精品| 国产国产精品人在线观看| 精品视频在线免费观看 | 四虎永久在线日韩精品观看| 91精品国产免费久久国语蜜臀| 人妻精品久久久久中文字幕69 | 久久精品国产亚洲av高清漫画| 精品国产亚洲一区二区三区| 老司机69精品成免费视频| 热综合一本伊人久久精品| 日韩精品一区二区三区影院| 精品一区精品二区| 日韩精品中文字幕第2页| 人妻少妇精品久久| 日韩精品在线播放| 6一12呦女精品| 9丨精品国产高清自在线看| 9久久9久久精品| 久久99精品国产99久久6男男| 日本精品中文字幕| 熟妇无码乱子成人精品| 精品一区二区三区无码免费视频 | 人妻熟妇乱又伦精品视频APP| 久久99精品久久久久久清纯|