Java代写 | 4483/8995 Software Technology Main Assignment Part 1

University of Canberra

Faculty of Science and Technology

 

4483 Software Technology 1 and

8995 Software Technology 1 G

Semester WT, 2019

Main Assignment  Part 1

(25% of grade Optional Assignment)

 

Due: End Week 7 (Submission on Canvas)  

The House Cost Calculator Assignment

 

GENERAL INSTRUCTIONS

 

This assignment should be done individually. The submission should be made as a single zipped file including a BlueJ project and submitted in Canvas.

 

Students should be aware that I may do some kind of plagiarism check.

 

Note: code must be in BlueJ, code written and submitted in any other Java environment may not be able to be marked.

 

This assignment is marked as a submission of a single zip file. It should be submitted to Canvas by its due date (see above). You need to submit:

  • The java program code (working or not) as a BlueJ project directory;
  • A test plan;
  • Documented results of your test plan;
  • Evidence of you running a number of mandatory, well documented, test runs (e.g. screen shots); These are the results of mandatory test runs (test runs are detailed in a separate document);
  • A short reflection report on what you learned;
  • An optional feedback (of the unit). Just a paragraph to me which is not marked;
  • Remember:” a single zipped file including a BlueJ project and submitted in Canvas.”

 

There are no resubmission options for this assignment.

 

This assignment is marked after semester ends in the exam period, resubmissions will NOT be possible.

 

You can ask for help in the tutorials, PALS, and hints, but the assignment should be your own work.

 

 

Assignment Briefing:

 

This is similar to MT1 with the following main changes.

  • The Bank and Interest rates table is read from a file ‘BankIr1.txt’ or BankIr2.txt (these represent different date periods. Interest rates are lower in BankIr2.txt; Imagine hearing that the reserve bank of Australia lowered interest rates);
  • There is a HOME3 loan type in some banks with just a 25 year repayment period instead of the 30 years applied to all loans
  • Calculation of stamp duty is included as an extra cost
  • There is an extra report called the investor comparison report where the input details of the investor report are read from a file of possible property deals that the investor is considering. The program then automatically finds the best one (the one with either the best profit or lowest cost)
  • You need to do some documentation (reflection report and test plan);
  • You need to run (and document – probably with screen shots) some mandatory tests (mandatory test runs are detailed in a separate document)
  • You need to zip up the project as a BlueJ project with the documentation and submit it on Canvas.

 

Important NOTE: You do need to allow for input of non-numeric in numeric inputs. My test cases will include things like entering ‘fred’ in the ‘cost of property’ field. So, you need to use exceptions.

 

There are 6 mandatory test you must run and document (these are in a separate document). I expect you to run and document additional tests that you have written yourself.

 

Here in Australia the housing market is divided into mainly two kinds of purchasers.

  • First Home Buyers
  • Investors

 

The system you need to build helps both kinds of customers with different reports by providing the following services:

 

  • For first home buyers it will give them a report on how much they need to pay each month as a repayment;
  • For investors it will report if the property is positive or negative cash flow;

 

The Bank Id, Loan Type, current Interest Rate, loan establishment fee, and the maximum percentage of purchase price to be borrowed are read from the file ‘BankIr1.txt’:

 

Below is a copy of the file BankIr1.txt

WESTPAC,HOME,3.69,395,80

WESTPAC,INV,3.69,395,95

COMB,HOME,3.69,600,95

COMB,INV,3.72,600,95

ANZ,HOME,3.28,500,95

ANZ,HOME2,3.22,600,80

ANZ,HOME3,3.20,900,85

NAB,HOME,3.53,790,90

NAB,INV,3.63,190,95

INTEL,INV,4.86,0,95

BEYOND,HOME2,3.69,0,95

 

Note advanced students should read this into several arrays or even just one array with a data class, but it’s also possible to just open the file when you need it and look for the one line you need thus you don’t need to use arrays to complete the assignment for a good mark.

 

You can assume that these files BankIr1.txt and BankIr2.txt do not contain errors, in that all fields are in range and the correct type.

 

  • For HOME, HOME2 and INV Loans the term in Years is 30 years (or 30*12 months = 360 months, 360 Payments); but
  • For HOME3 Loans the term in Years is 25 years (or 25*12 months = 300 months, 300 Payments);

 

Stamp Duty is based on the value of the property and varies as shown on the following table. The value is rounded to the nearest dollar (using normal mathematical rounding). It is discounted for first home buyers who are buying a house up to $750,000 in value

Low valueHigh ValueFirst Home BuyerInvestor
$0$200,000$20$20
$200,001$300,000$500$2,600
$300,001$500,000$1,000$4,900
$500,001$750,000$2,400$12,100
$750,001$1,000,000$23,500$23,500

 

 

NOTE1: The above rates and information is based on reality but is not reality, it’s simplified for the assignment. Banks have all kinds of varying terms and conditions to make it hard to compare one bank with another. the above table is not a reflection of reality; it’s a first-year assignment example.

 

 

The program must have

  • A clear easy to use main menu with an exit

 

  • Displays a table above based on the RatesIr1.txt file called “rates report 1”.

 

  • Displays a table above based on the RatesIr2.txt file called “rates report 2”.

 

  • It produces a report “First Home Buyer report” for a first home buyer of what they will repay each month including a line for stamp duty.

 

  • It produces a ‘Investor report’ for an investor for a proposed purchase with a given rental. If the property is cashflow negative then this will be a negative number or it could be positive (unlikely in the act at this time for properties with a 20% deposit or less).

 

  • It produces a ‘Investor Comparison Report’ for an investor for a list of proposed properties read from a designated input file (one of invRep1.txt, invRep2.txt, InvRep3.txt). It should identify the most profitable property. This report is worth only 2 points of the 25, so it’s optional.

 

  • Note also that some input errors should be detected specifically:
    • Bank codes must be in the BankIr file
    • Cost of property must be between 150,000 and 1,000,000
    • Loan type must be INV, HOME, HOME2, HOME3
    • Deposit must be between 0 and the cost of the property
    • The rent must be between $100 to $1000
    • Inputs that are numeric must be checked and correctly processed if they do not contain numbers (e.g. an input of the word Fred).
    • NOTE/WARNING – On my marking sheet test cases will check some of this editing

 

 

Calculation of First Home buyer repayments

 

Before we can calculate the repayments there are a few inputs needed:

  1. the cost of the property
  2. The bank
  3. The loan type (Home or Home2)
  4. The amount of deposit

 

Also, in the ACT a $7,000 grant is given to new home buyers; this needs to be added to the deposit (assume this program is for the ACT only).

 

We are ignoring stamp duty which is low for first home buyers

 

StepActionNotes
1input and check The cost of the propertyRange 150,000 to 1,000,000
2aInput interest rate table

(1 for the interest rates in BankI1.txt)

(2 for the interest rates in BankI2.txt)

2binput and check The bank codeWESTPAC, COMB, etc.
3input and check loan typeHOME, HOME2, HOME3
4input and check amount of depositRange 0 to cost of property
5aLook up stamp duty
5bAdd 7000 to deposit to give final deposit
6Add loan establishment fee and stamp duty to cost of property giving amount needed
7Subtract final deposit from amount needed giving amount of loan
8Compute % being loaned

(amount of loan)/(cost of the property)*100

 

9Check that the loan is for less than or equal to the max % that can be borrowedIf not print a message and return to menu
10Convert the % interest rate to a decimalEg 3.71% would become 0.0371
11Use the supplied formulae to find the monthly repaymentsThis is the method ‘calcMonthPayment’
12Display all the details – see example run

 

Example Calculation: (WESTPAC HOME  3.69%    395     80%)

StepActionNotes
1input and check The cost of the property300,000
2aInput interest rate table

(1 for the interest rates in BankI1.txt)

(2 for the interest rates in BankI2.txt)

1
2binput and check The bank codeWESTPAC
3input and check loan typeHOME
4input and check amount of deposit50,000
5aLook up stamp duty500
5bAdd 7000 to deposit to give final deposit57,000
6Add loan establishment fee and stamp duty to cost of property giving amount needed300,000+500+395

=300,895

7Subtract final deposit from amount needed giving amount of loan300,895 – 57,000

=243,895

8Compute % being loaned

(amount of loan)/(cost of the property)*100

243,895/300,000 = 0.81298

=

9Check that the loan is for less than or equal to the max % that can be borrowed81.298 < 80 (false)

 

print an error message and return to menu

10Convert the % interest rate to a decimal
11Use the supplied formulae to find the monthly repayments
12Display all the details – see example run

 

Example Calculation: (WESTPAC HOME  3.69%    395     80%)

StepActionNotes
1input and check The cost of the property300,000
2aInput interest rate table

(1 for the interest rates in BankI1.txt)

(2 for the interest rates in BankI2.txt)

1
2binput and check The bank codeWESTPAC
3input and check loan typeHOME
4input and check amount of deposit65,000
5aLook up stamp duty500
5bAdd 7000 to deposit to give final deposit72,000
6Add loan establishment fee and stamp duty to cost of property giving amount needed300,000+500+395

=300,895

7Subtract final deposit from amount needed giving amount of loan300,895 – 72,000

=228,895

8Compute % being loaned

(amount of loan)/(cost of the property)*100

228,895/300,000 = 0.7629

=

9Check that the loan is for less than or equal to the max % that can be borrowed76.29 < 80 (true)

 

10Convert the % interest rate to a decimal0.0369
11Use the supplied formulae to find the monthly repayments-$1,052.27

 

12Display all the details – see example run

 

 

 

 

 

Calculation of Investor Report

 

Before we can calculate the repayments there are a few inputs needed:

  1. the cost of the property
  2. The bank
  3. The loan type (Home or Home2)
  4. The amount of deposit
  5. The expected weekly rent

 

Also for cash flow purposes:

  • The rent received is typically for 50 weeks (not 52 – this allows for 2 weeks of vacancy)
  • 10% of the rent goes to the renting agent
  • Roughly 4% of the rent goes on maintenance
  • About 6% of the rent goes in land tax, rates and other holding costs

 

StepActionNotes
First do the cost calculation
1input and check The cost of the propertyRange 150,000 to 1,000,000
2aInput interest rate table

(1 for the interest rates in BankI1.txt)

(2 for the interest rates in BankI2.txt)

2binput and check The bank codeWESTPAC, COMB, etc.
(3)Loan type will be INV
4ainput and check amount of depositRange 0 to cost of property
5Input and check weekly rentRange $100 to $1000
6aLookup the stamp duty
6bAdd loan establishment fee and stamp duty to cost of property giving amount needed
7Subtract final deposit from cost of the property giving amount of loan
8Compute % being loaned

(amount of loan)/(cost of the property)*100

 

9Check that the loan is for less than or equal to the max % that can be borrowedIf not print a message and return to menu
10Convert the % interest rate to a decimalEg 3.71% would become 0.0371
11Use the supplied formulae to find the monthly repaymentsThis is the method ‘calcMonthPayment’
Now we do the Income Calculation
12Take the weekly rent multiply by 50 giving gross rent
13Now multiply the gross rent by 0.8 giving gross income10%+4%+6% = 20%

100%-20% = 80%

80% >> *0.8

14Now divide the gross income by 12 giving monthly income
Now we do the Cashflow Calculation
15Subtract the monthly repayments from monthly income to give monthly cash flow
16Display all the details – see example run

 

Example Calculation: (WESTPAC INV       3.61%    395 95%)

StepActionNotes
1input and check The cost of the property400,000
2aInput interest rate table

(1 for the interest rates in BankI1.txt)

(2 for the interest rates in BankI2.txt)

2
2binput and check The bank codeWESTPAC
(3)Loan type input not needed will be INV
4ainput and check amount of deposit45,000
5Input and check weekly rent$530
6aLookup stamp duty4,900
6bAdd loan establishment fee and stamp duty to cost of property giving amount needed400,000 +4,900+395

=405,295

7Subtract deposit from amount needed giving amount of loan405,295-45,000

=360295

8Compute % being loaned

(amount of loan)/(cost of the property)*100

360295/400000=.9007

 

9Check that the loan is for less than or equal to the max % that can be borrowed.9007 < 0.95 (true)
10Convert the % interest rate to a decimal0.0361
11Use the supplied formulae to find the monthly repaymentsCalculated in Excel this is:

-$1,640.09

Now we do the Income Calculation
12Take the weekly rent multiply by 50 giving gross rent530*50 = 26,500
13Now multiply the gross rent by 0.8 giving gross income26500*0.8 = 21,200
14Now divide the gross income by 12 giving monthly income21,200/12=1,766.66
Now we do the Cashflow Calculation
15Subtract the monthly repayments from monthly income to give monthly cash flow1,766.66-1,640.09 = 126.57

 

Yep in this case you have a profit of $126.57 per month

16Display all the details – see example run

 

 

 

 

 

 

 

 

 

Notes

 

During my testing I found small rounding errors were affecting the result. Consequently, I will allow minor rounding errors in the answer (about 1cent).

 

The Excel PMT function can help in the creation of test data

The following formulae will give the repayments on a loan of $20,000 over 3 years at 5%

 

=PMT(0.05/12,3*12,20000)   The correct answer is 599.42

 

This website seems to use the same formula as me (as detailed below) accurate to the nearest cent: It may help in testing.

 

http://www.calculator.net/loan-calculator.html?cloanamount=40000&cloanterm=7&cloantermmonth=0&cinterestrate=3&ccompound=monthly&cpayback=month&x=69&y=5

 

The formula I used can be found on Wikipedia. Most students don’t need this level of detail but it’s here for the curious.

 

https://en.wikipedia.org/wiki/Amortization_calculator

 

 

double calcMonthPayment(double yearlyrate, double loan, int years)

{

/* Inputs to this routine are:

yearlyrate – the yearly interest rate as a decimal

(eg a 5% interest rate would be entered as 0.05)

loan – the amount of the loan in dollars and cents (eg 21210.90)

years – an integer indicating the years of the loan (eg 3 )

*/

double retv;

int payments;

double mul;

double rate;

rate = yearlyrate / 12;

payments = years * 12;

mul = Math.pow(1 + rate, payments);

retv = (loan * mul * rate) / (mul – 1);

return retv;

}

 

 

I provide some code as follows:

 

I provide a menu example which uses a do while loop and has two options A and B (as well as an exit)

 

The following code is how I input bank code

System.out.printf(“\nEnter Bank Id: “);

String ban = in.nextLine();

//ban=ban.trim().toUpperCase();// you may want this

 

This a redacted/deleted code fragment of how I input cost of property

System.out.printf(“\nEnter Cost Of property: “);

double cp;

 

try

{

cp = in.nextDouble();

}

catch (InputMismatchException e)

{

// … code redacted/deleted …

}

 

// … code redacted/deleted …

String temp = in.nextLine();

 

 

I give you this code so you can use it (i.e. it’s ok to copy and or modify the supplied code).

 

How to Get Started

 

This may look daunting but it’s not much more than MT1 (your MT1 code is a good starting point). If you need to get started then look at MT1 and follow the getting started part of that assignment  – because this Assignment is very similar.

 

 

 

 

Marking Rubric

Marking (This assignment part is worth 25 marks).

MarksFeature
7Good test plan and evidence of testing
6Your program code, accuracy, functionality and formatting
1You used arrays
1You built a class to hold interest and bank data or as part of the investor comparison report
2You coded the investor comparison report
2Reflection Report
6Results of mandatory testing
-2First mandatory test that’s wrong
-1Subsequent mandatory tests wrong
-1 to -3Program has non-fatal significant bug
Maximum of 12 marks for assignmentProgram fatally crashes or won’t compile or is basically not working
Minimum of 13 marks for assignmentProgram basically works and is acceptably documented with a test plan.
-0.5 to -25Program is not a BlueJ project or is not a Zip file. My tutors are not responsible for converting your project from (insert your IDE here) to BlueJ.
Late submission5% per day up to 1 week then a mark of 0

Watch the Canvas site for late class wide extensions that may be given

 

Example Runs

 

Menu Exit

 

Rates Report R1

 

 

 

 

First Home Buyers

 

 

 

 

Investment Loan

 

 

Error Case: Borrowing is too high a percentage

 

 

 

 

Example ‘investor comparison report’

 

 

 

Error case:  ANZ has no INV loan type

 

 

Partial Example: disallowed loan in the Investor comparison report

 

 

Error case: enter the word bozo instead of cost

 

 

 

 

 


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:dmxyzl003


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

发表评论