Create a program to simulate a bank atm

Assignment Help JAVA Programming
Reference no: EM132366222

Assignment

Objectives

This assignment requires you to create a program in Java programming language to simulate a bank ATM.

Upon completion of this assignment, you should be able to create object-oriented programs using classes and objects with methods that use proper data types, variables, arithmetic expressions, simple control flow and interaction with users through simple input and output devices.

General Requirements

• You should create your programs with good programming style and form using proper blank spaces, indentation and braces to make your code easy to read and understand;
• You should create identifiers with sensible names;
• You should make comments to describe your code segments where they are necessary for readers to understand what your code intends to achieve.
• Logical structures and statements are properly used for specific purposes.
• Other requirements as stated in Submission section.
• All your program files should include the following header. Submissions without this header will not be marked and the zero mark will be given.

/**
* CSIT111/CSIT811 Assignment 1
*
* Student name:
* Student user ID:
* Student number:
*/

• You should only use Java language structures covered up to Week 5.

Tasks

You will create a Java program called ATMApp.java. This program will make use of a class called ATM.

Task 1: ATMApp program

You create your ATMApp program according to the following requirements.

1. The ATMApp program will read a saved PIN and account balances for Savings and Checking accounts; The file stored the values is provided as balances.txt. The file name will be provided to the program as command line argument.

2. The program then will ask for PIN. The entered PIN will be compared with the saved PIN. If the entered PIN is not the same as the saved PIN, the program will continue asking for correct PIN.

The saved PIN is a hashed value from a 6-digit PIN. The hash function used to create the saved PIN is defined as

hash(x) = (x * A) mod (232)

where A = 2654435761.

3. Once the PIN is verified, the program will show the main menu of the ATM machine.

Task 2: ATM class

The ATM class models an ATM machine and supports your ATMApp program. You will create the ATM class according to the following requirements.

1. The class will have fields to store balances of both Savings and Checking accounts and the selected account.

The ATM will provide the following methods:

2. A constructor that receives balances for both accounts.
3. selectAccount method will prompt the customer to select an account from a list of Savings and Checking accounts. This method will display the following screen prompt and take customer input.

1 - Savings
2 - Checkings Which account:

4. showMainMenu method will show the main menu of the ATM machine for transactions. The customer can select what to do from a list. The method will display the following screen prompt and take customer input.

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit

5. deposit method will deposit an amount entered by the customer and updates and display the updated balance.

6. withdraw method will withdraw an amount entered by the customer and updates and display the updated balance if the amount to withdraw is less than the current balance. Otherwise, it will show a message "Insufficient balance".
7. displayBalance method will display the current balance of the account. The monetary value will be displayed as dollars and cents.

You need to observe the sample screenshot in the Testing section to understand more how the program will interact with the customer and implement your program to realise it.

Testing

The saved PIN in the provided balances.txt file is the hashed value of 2522.

(User input is in red colour, results in blue colour and prompt lines in black colour. Colours in this paper are for readability only. Your program does not need to print in color.)

java ATMApp balances.txt

Please enter your PIN: 2000

Please enter your correct PIN: 2522

1 - Savings
2 - Checking Which account: 1

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 1
The current balance is $10000.00

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 2
Enter the amount to withdraw: 500.50 The current balance is $9499.50

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 3
Enter the amount to deposit: 1500 The current balance is $10999.50

1 - Inquire Balance
2 - Withdraw
3 - Deposit

4 - Other account
0 - Quit 4

1 - Savings
2 - Checking Which account: 2

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 1
The current balance is $20000.00

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 2
Enter the amount to withdraw: 15000 The current balance is $5000.00

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 2
Enter the amount to withdraw: 10000 Insufficient balance.

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 3
Enter the amount to deposit: 1000 The current balance is $6000.00

1 - Inquire Balance
2 - Withdraw
3 - Deposit
4 - Other account
0 - Quit 0

Your program may be tested with different balances, PIN and user input.

Reference no: EM132366222

Questions Cloud

What should the firm do in the long run : What should the firm do in the short run? What should the firm do in the long run?
What are the main considerations in processing big data : What are the three characteristics of Big Data, and what are the main considerations in processing Big Data?
Government freezes the price of gasoline : If the government freezes the price of gasoline at its initial equilibrium price, how much of a surplus or shortage will exist when supply is reduced
Briefly identify the two types of public servants : Briefly identify/name the two types of public servants, and explain why it's important for these two types of servants to receive this education?
Create a program to simulate a bank atm : CSIT111 - Programming Fundamentals - University of Wollongong - create a program in Java programming language to simulate a bank ATM
Calculate the working age population : i. Calculate the working age population. ii. There are 25,535 people unemployed. Calculate the unemployment rate.
How did you conduct your investigation : How did you conduct your investigation? Provide a high-level description of your starting point, the databases you used, and how you decided where and when.
Interdependence of macro and micro economics : What is the interdependence of macro and micro economics?
Why was the manufacturer losing money on program : Why was the manufacturer losing money on this program? What should the manufacturer do to stop losing money?

Reviews

len2366222

9/5/2019 2:41:23 AM

• Late submissions will attract a penalty of 100% of the assessment mark and not be marked. • Any submission that results in compiling errors will have 50% marks deducted (5 marks). Mark to 0.5 divisions. General requirements -0.5 ~ -1.0 mark for each error Task 1 1 1 2 1 3 1 Task 2 1 0.5 2 0.5 3 1 4 2.5 5 0.5 6 1 7 1

len2366222

9/5/2019 2:41:14 AM

Submission • Achieve ATMApp.java and ATM.java files into a file called a1.zip. • Submit a1.zip file from your University Unix account on Banshee (banshee.uow.edu.au) as follows: Submit before the due time: submit -u YourUnixID -c CSIT111 -a a1 a1.zip Submit after the due time with AC: submit -u YourUnixID -c CSIT111 -a a1-late a1.zip

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd