Australia media debated and discussed recently a lot over affordability of own house for first home owners and for a month it was daily headlines of the newspaper, as some individual made a remark that new generation people spends a lot on takeaway coffees and avocado on toasts and if they stop buying it for some time they can save the money for the house deposit. This remark made a sensation amongst new generation’s people and they are thinking over the idea. This report has been made in order to implement the same idea and provide an approximation of savings it could generate.
The aim of this project is to develop software that would calculate the number of avocados people need to not buy so that they could save enough for their house deposit they are looking for. Also, if they start saving it today than at what week of the year it would be enough savings, which they could submit for the house deposit.
This is the simplest level of the program but responsible for essential components of the source code. All the modules related to formatting of the text, welcome display message and its formatting, etc. comes under basic functionality. In this program it is responsible for:
- Displaying a welcome message which must be decorated with a row of asterisk at the bottom and top.
- A menu of desired tasks, which needs to be done in order a take input from the user and to provide them calculated output.
- After receiving the desired choice of user, displaying them appropriate message to enter values for their dream houses and price of avocado they usually buy and in case any invalid value is entered then prompting them to inform the same and asking to re-enter the value.
- After Getting all the useful information from the user, a calculation must be performed internally which is not accessible to user and they are provided with an output of how many avocados they have to not buy in order to save money for the deposit of the house.
- After successful transaction, the user may choose to exit the system and in case user choses to exit the system, a message should be displayed “The House Deposit Calculator is now Exiting”. And in case the user chose for another transaction it must be performed flawlessly.
This is the next level in the program development and responsible for well readable code which can be achieved through modularizing the code and other readable actions which are:
- Separate methods for each functionality and calculation and use of correct method calls.
- No use of magic numbers and should be replaced with variables and constants as appropriate.
- Making the code more readable through indentation and white spacing.
- Necessary comments which ensure the purpose of the code and can help the future programmers to under the code.
- Each constant and variable in the program must have a name that specifies its task and purpose identically.
This is responsible for advanced level coding in the program and enhancing the Deposit Calculator module to calculate the date by which deposit will be enough, depending upon user-specified number of avocado on toast purchases per week of the user.
- A message will be prompted on screen of the user for entering the user-specified number of avocado on toast purchases per week. The value entered must be greater than 0 and if it is not, the entry should be considered invalid and user must be asked again to input the valid value.
- The system’s current date should be used to calculate future week when the deposit will be collected.
- After the result has been displayed, menu should again be redisplayed to the user to make a choice.
- Scalability: The software should be accessible and all the actions of user should be met properly and timely.
- Reliability: The developed software must be very reliable as it will also generate prices according to the time duration, so it must be very accurate otherwise customers may lose their faith in the software
Test case |
Expected Result |
Actual result |
The user selects “Enter House Prices” |
User will be prompted three times to enter three different prices of Cheapest House, Chosen House and Median house. |
Test case |
Expected Result |
Actual result |
The user enters invalid value for cheapest house |
The user will be prompted with a message “Invalid Value: Please Retry”. |
Test case |
Expected Result |
Actual result |
The user enters value for chosen house or cheapest house which is less than that of cheapest house |
The user will be prompted with a message “Invalid value: Value should be greater than cheapest House”. |
Test case |
Expected Result |
Actual result |
The user selects deposit calculator option from menu without entering house prices and avocado prices |
The user will be prompted with a message “Please enter Housing prices and avocado price first”. |
Test case |
Expected Result |
Actual result |
The user select option 2 from menu “Enter avocado on toast price” |
The user will be prompted with a message “Enter the price (in whole dollars) of avocado on toast from a local cafe or restaurant”. |
Test case |
Expected Result |
Actual result |
The user selects option 3 from menu “ Deposit Calculator” |
The user will be prompted with actual number of avocados that he will not need to buy three respective houses. The prices and deposit will be rounded off to two decimal places. |
Test case |
Expected Result |
Actual result |
The user enters value 0 for number of times avocado purchased weekly |
The user is prompted with a message” Value must be greater than 0”. |
Test case |
Expected Result |
Actual result |
The user enter invalid value option when menu is displayed |
Message to user “Please select valid value”. |
Test case |
Expected Result |
Actual result |
The user enters value 4 when menu is displayed |
Message to user “Housing price Calculator is now exiting” and exit from the system without using System.exit() but end of program. |
References
Herman Schildt, The Complete Reference -Java2 (Tata McGraw-Hill, 2008).
Dietel and Mathews Dietel, Java How to Program, (Pearson Education, 7th ed. 2008)
Burton, Kelley, Thomas Crofts and Stella Tarrant, Principles of Java (Corebook, 2011)
Martin, Paul et al (eds), Reference Java and Advanced Functionality (Edward Elgar, 2012)
Berryman, Jeff and Robyn Carroll, ‘Cy-près as a Class Action Remedy – Justly Maligned or Just Misunderstood?’ in Kit Barker and Darryn Jensen (eds), Private Code: Key Encounters with Public Programming (Cambridge University Press, 2013).