联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> javajava

日期:2018-09-13 01:53


SENG1110/6110 Programming Assignment 1 – Semester 2, 2018

GOODMATES LOAN INSTITUTION - Help to start

This document aims to give some initial steps to help you to start the assignment 1. Note that you do not need to follow

exactly these steps in the same order. In addition, the suggestions in each step are just one of the several options that you

have to implement the assignment. Note as well that these are just a starting point. Each time that you implement a new

method, test it before proceeding. It will save you time.

Step 1.

Write the first version of Account.java (there is a template already available to you in Blackboard)

From the assignment specification, declare the instance variables. Compile.

Implement a couple of the methods. You can start with setMonths() and getMonths(), for example. Compile.

Step2.

Write the first version of Client.java (there is a template already available to you in Blackboard).

From the assignment specification, declare the instance variables. Compile.

Implement a couple of the methods. You can start with setName() and getName(), for example. Compile.

Step3.

Write the first version of LoanCalculator.java (there is a template already available to you in Blackboard).

Let’s first write some statements to test the class Client.

Write the following statements in the method run() in LoanCalculator.java (some of them are already written in the

template):

Scanner console = new Scanner(System.in);

Client client = new Client();

String name;

System.out.print("name? ");

Client.setName(name);

System.out.println("name = "+client.getName());

Compile and run. If it works, then implement the next set/get methods in Client and try the same test.

After testing, delete these lines (they were used just for testing your Client class).

When you finish the implementation of all get/set methods in Client, then go to the next step.

Step5.

Let’s first write some statements in LoanCalculator.java to test the class Account.

Write the following statements in the method run() in LoanCalculator.java (some of them are already written in the

template):

Scanner console = new Scanner(System.in);

Account accountTest = new Account();

int months;

System.out.print("months? ");

accountTest.setMonths(months);

System.out.println("months = "+ accountTest.getMonths());

Compile and run. If it works, then implement the next methods in Account and try the same test.

After testing, delete these lines (they were used just for testing your Account class).

When you finish the implementation of all get/set methods in Account, then go to the next step.

Step 7.

Write the initial statements to ask and receive inputs from the user (name, age, income, amount, numberOfMonths,

typeOfAccount). Remember to check if the input numbers are positive. If they are negative, you should ask the input again.

Now you can instantiate the object client with these inputs. There are different ways to do this. Ask help if you are not sure

how to do it.


Step8.

Now go to the assignment instructions and implement each functionality. Remember to implement each one, compile, test

and when it is all working, go to the next one.

As said above, these steps are just the starting point. Depending on the questions from students, I will add more information

in Blackboard and send an email to all to let you know. Remember to use the discussion board to post your questions, but DO

NOT post your code.

Prof Regina Berretta – Aug 2018


版权所有:留学生程序网 2020 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。