Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA ROGRAM QUESTION. Create a class called ATM that has a String called type, an int called number and a double variable called balance. It

JAVA ROGRAM QUESTION. Create a class called ATM that has a String called type, an int called number and a double variable called balance. It has a no argument constructor that sets all the values to nothingness. It has the getter and setter methods.It will have a method called setAccountNumber() that will have the user enter the 4 digit pin and set the number. It will have a setType() that will have the user enter in 1 for checking or 2 for savings and it will set the account to correct type based on a choice. It also has a computeTransaction() as a void that will ask the user to enter in 1 for deposit or 2 for withdrawal and it will compute and set the balance to appropriate value. It will have a toString() that will output each account object in the following format

Account Number 1234

Account Type Checking

Account Balance $1234.56

Create a class called ATMDemo that will have the following

An object called atm1

Create code to display the following

Welcome to ATM Bank of (your name choice goes here)

Please insert your card for the transaction

Call the setAccountNumber()

Now call the setType() method Now call the computeTransaction() method

Now output the information of the object

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions