Write programs that use object oriented programming concepts

Assignment Help JAVA Programming
Reference no: EM131849108

Assignment

Outcomes

• Write programs that use object oriented programming concepts.
• Write programs that use objects.
• Write programs that use ArrayList.
• Write applications using object oriented programming concepts.

Part 1

Create a folder to store the files of your Homework01.

Inside this folder, create a file called Transaction.java which will contain the following class and its data fields.

382_Class.jpg

The name of your class is Transaction. It contains 4 data fields: id (int type), amount (double type), type (char type), description (String type).

The data field called type represents the type of transaction. For this program, the types are ‘W' (withdraw), and ‘D' (deposit).

In the class, add a constructor which requires 4 input arguments which will be assigned to each of the corresponding data fields. See below an example of the header of the constructor: public

Transaction(String argId, double argAmount, char argType, String argDescription)

In the same folder, create a program (Java file) which will contain the main method. The name for this file is Homework01.java.

In this file, in the main method, create an ArrayList object named transactionList. Then, create a functional program menu like the following example:

Transaction list menu

1. Add transaction.
2. Search transaction.
3. Filter.
4. Display all transactions.
5. Exit.

Enter your choice: _

Besides, create the methods for the 4 first options:

public static void addTransaction(ArrayList<Transaction> argList) public
static void searchTransaction(ArrayList<Transaction>argList) public
static void filterTransactions(ArrayList<Transaction> argList) public
static void displayTransactions(ArrayList<Transaction> argList)

Notice the four methods do not return a value (void) and they receive as argument an ArrayList reference which will be transactionList. So, once an option is chosen, the corresponding method should be called.

Part 2

=== Add Transaction
Enter transaction Id: 8 Transaction
type [W, D]: W
Amount: 1000
Description: Apartment rent Transaction created!

Once any of this processes (add / search / search / display) is completed, the application must return to the menu.

Part 3

The functionality of the method searchTransaction should be like the example below.

=== Search Transaction
Enter transaction Id: 8
Id: 8
Type: W
Amount: 1000.00

Description: Apartment rent Transaction found!

When the transaction Id is not found the functionality should be like the example below.

=== Search Transaction
Enter transaction Id: 8 Transaction
not found!

Part 4

The functionality of the method displayTransactions should be like the example below.

=== Display Transactions
Id   type       amount       description
8      W        1000.00       Apartment rent
10    D         2100.00       Salary

Part 5

The functionality of the method filterTransactions should be like the example below.

=== Filter Transactions
Enter query: >500.50
Id   type       amount       description
8      W        1000.00       Apartment rent
10    D         2100.00       Salary

This module should take the query, and identify the first character which could be > (less than) or < (greater than); then the rest of the query should be a double value. In the example above, the query means: show all transactions with amount greater than 500.50.

Another example:

=== Filter Transactions
Enter query: <2000
Id   type       amount       description
8      W        1000.00       Apartment rent

In this example the query means: show all transactions with amount lower than 2000.00. In addition, when no transaction match the query, the functionality should be like the example below.

=== Filter Transactions
Enter query: <100
Id   type       amount       description
No transactions found!

Other requirements

- For this program, you only need to validate the option selection in the menu i.e. the selected option should be a value between 1-5; otherwise, it should show an error message, and show the menu again and ask for another selection.

- Once the program is complete. Compress the folder (create a zip file) with the java files and submit it to the corresponding assignment in Canvas. The name of the zip file should be Homework01.zip

Reference no: EM131849108

Questions Cloud

Change in the power of the sound emitted : Part A: What is the change in the power of the sound emitted by your stereo?
What is the public key pu and what is the cipertext c : What is the public key PU? What is the private key PR? What is the cipertext C? How does the decryption to covert the ciphertext back to the plaintext M?
What is the power of the emitted signal : On a whale-watching expedition, your underwater sound detector picks up a whale sound that has an intensity of 9.0 µW/m2.
What is the spring constant : Suppose a 0.5-kg mass on a spring that has been compressed 0.1 m has elastic potential energy of 1.2 J. What is the spring constant?
Write programs that use object oriented programming concepts : Write programs that use object oriented programming concepts. Write applications using object oriented programming concepts.
Surrounding the use of a pacemaker therapy : What are the controversies or unresolved issues surrounding the use of a pacemaker therapy?
Ignite or turn on a stove burner : Ignite or turn on a stove burner. Fill an empty soda can with about 4 mL of water. Clasp the can with beaker tongs and heat
Direction of the velocity of the second spacecraft : Find the magnitude and direction of the velocity of the second spacecraft as measured by the pilot of the first spacecraft
How global businesses lead and share information : Describe one local business, and one global business; and discuss how their sustainability efforts are either hypocritical or morally responsible and why

Reviews

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