자바 과제 인데요 제가 초보라 너무 어렵네요 좀 알려주실분.. 거기다 영어라
알찬해
ObjectiveThis exercise will introduce you to the banking project which we will return to in several labs. This project will (eventually) consist of a bank with several customers with several account each and a report. These classes will evolve over the next lab exercises.
In this exercise, you will create very simple version of the Account class. You will place this source file in the banking package. A test program, TestBanking, has been written in the default package that creates a single account. It initializes the balance of that account and performs several simple transactions. Finally, the test program displays the final balance of the account.
DirectionsStart by changing your working directory to lab4/exercise2 on your computer.
Create the banking directory in your working directory. Create the Account class in the file Account.java under the banking directory. This class must implement the model in the above UML diagram. declare one private object attribute: balance; this attribute will hold the current (or running) balance of the bank account declare a public constructor that takes one parameter (init_balance); that populates the balance attribute declare a public method getBalance that retrieves the current balance declare a public method deposit that adds the amount parameter to the current balance declare a public method withdraw that removes the amount parameter from the current balance Compile the given TestBanking.java file. This has a cascading effect of compiling all of the classes used in the program; thus compiling the Customer.java and Account.java files under the banking directory.
javac -d . TestBanking.javaRun the TestBanking class. You shoud see the following output: Creating an account with a 500.00 balance.Withdraw 150.00Deposit 22.50Withdraw 47.62The account has a balance of 324.88
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2695934 | tr 속성값 (9) | 새 | 2025-05-25 |
2695905 | ASP로 개발됐을 때 css가 달라져요 ㅠㅠ (4) | 슬아라 | 2025-05-24 |
2695878 | form을 이용한 다른 페이지로 넘기는 방법을 알려주세요 (1) | 핫파랑 | 2025-05-24 |
2695844 | 저기 암호화 및 복호화 프로그램.. 만들어볼려는대 (2) | 한빛 | 2025-05-24 |
2695814 | [질문] PDA에서 애플릿이 가능한가요? (1) | 봄시내 | 2025-05-24 |
2695785 | 웹 설정 도와줄분 | 화이트캣 | 2025-05-23 |
2695730 | 갑자기 기억이 안나는데 accesskey 속성.. | 빛나라 | 2025-05-23 |
2695702 | [질문] Java 버전 차이에 의한 오류?!! (2) | 검사 | 2025-05-23 |
2695672 | 자바 임베디드 쪽으로 배우고 싶은데요..질문이요.. (1) | 뽀그리 | 2025-05-22 |
2695647 | 헉! 이클립스(v3.1)에서 발생되는 널포인트 익셉션? ;;; (3) | 아빠몬 | 2025-05-22 |
2695586 | IFRAME 캐싱 질문 | 봄나비 | 2025-05-22 |
2695498 | [질문]실행가능한 jar파일.. 정말 이해가 안가네요... ㅡㅜ;; | 터1프한렩 | 2025-05-21 |
2695468 | 자바랑 이클립스에서요.. | 스킬 | 2025-05-21 |
2695375 | Mysql 연동하는 자바 질문있습니다. | 아리솔 | 2025-05-20 |
2695319 | 파워포인트 파일을 저장할 수 있을까요? | 시윤 | 2025-05-19 |
2695289 | [질문]Tween 값의 정도를 알고 싶습니다. | 타마 | 2025-05-19 |
2695238 | c 와 c++의 시작 (10) | ChocoHoilc | 2025-05-18 |
2695215 | 탑메뉴의 repeat-x .배경이 두가지에요ㅠ ㅠ | 널위해 | 2025-05-18 |
2695187 | 자바스크립트와 자바의 import에 관해서 질문드려요 (1) | 무슬 | 2025-05-18 |
2695116 | 테마 문의 (해당 사이트와 같은 테마 혹은 플러그인) | Sweet | 2025-05-17 |