Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Payment Data Migration The Gaati Shipping Company wants to migrate all the old payment data maintained in legacy software to this application, The payment data

Payment Data Migration

The Gaati Shipping Company wants to migrate all the old payment data maintained in legacy software to this application, The payment data is in CSV format with all the details related to payment, credit card, and cheque. Since their data is too large, the number of historic records takes a lot of processing time and so use multi-threading to migrate the data. Write program to parse the csv formatted payment details and process them in threads, where the number of threads are provided.

Create class named Payment with the following member variables :

  • Long id Double amount
  • Date createdDate
  • Date paymentDate
  • Integer mode
  • CreditCard card
  • Cheque cheque
  • String status

Include appropriate getters and setters. And include a parameterized constructor with following order (id, amount, createdDate, paymentDate, mode, card, cheque, status).

Create another class named CreditCard with the following private member variables :

  • String cardNumber
  • Date cardExpire
  • String name
  • Integer cvv

Include appropriate getters and setters. And include a parameterized constructor with following order (cardNumber, cardExpire, name, cvv).

Create another class named Cheque with the following private member variable

  • String bankName
  • String chequeNumber
  • Date chequeDate

Include appropriate getters and setters. And include a parameterized constructor with following order (bankName, chequeNumber, chequeDate).

Create another class named BuildPaymentThread that extends the thread class with the following private member variables

  • List paymentList
  • List csvInput

Include appropriate getters and setters.

And include a parameterized constructor with the following order (paymentList, csvInput).

And also include the following methods in the class,

No Method Name Method Description 1 public void run() Override the run method,here you iterate the payment list which is in csv format and parse the string then convert it to payment object list. Create the class as Main, Get the inputs in the Main method, read n, the number of threads to be executed and get the comma-separated payment details. Split the Payment csv data list depending on the number of threads. Create two thread instances and pass the first half of the cargo list one thread and the other half to other thread and start the threads. Once the threads execution is completed, print the payment list of the thread instances.

[Note :Strictly adhere to the object oriented specifications given as a part of the problem statement.Use the same class names, attribute names and method names.]

Input Format :

The first input is an integer n that corresponds to the number of payments. The next n lines contain csv formatted payment details that are received in the form of strings. The last input is an integer that corresponds to the number of threads.

Output Format :

The output is a list of strings, each payment's details printed in a newline. Please refer to the sample input and output for more details and formatting specifications.

[All text in bold corresponds to input and rest corresponds to output.]

Sample Input and Output :

Enter the number of payments:

3

Enter all the payments :

1887845128,48200,08/04/2010,07/04/2010,2,M&TBank,445221,14/04/2010,SUCCESS 1888444588,5005000,15/04/2010,14/04/2010,1,4375512943814004,01/04/2012,John,450,FAILED 1887845128,48200,12/03/2010,11/03/2010,2,HSBC,445221,14/04/2010,SUCCESS

Enter number of threads to process the data :

2

1887845128 48200.0 2 M&T Bank 445221 Wed Apr 14 00:00:00 IST 2010 SUCCESS

1888444588 5005000.0 1 4375512943814004 John Sun Apr 01 00:00:00 IST 2012 FAILED

1887845128 48200.0 2 HSBC 445221 Wed Apr 14 00:00:00 IST 2010 SUCCESS

Don'ts:

1. Do not create packages for classes. Strictly adhere to the program structure given in the template code.

2. Do not use Internet Explorer, highly recommended to use chrome browser to launch tekstac platform.

3. Do not create multiple classes inside a single file. Create separate file for each class.

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_2

Step: 3

blur-text-image_3

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

Operations Management Managing Global Supply Chains

Authors: Ray R. Venkataraman, Jeffrey K. Pinto

1st edition

1506302935, 1506302939, 978-1506302935

More Books

Students also viewed these Programming questions

Question

What is a social role? (p. 30)

Answered: 1 week ago

Question

Compare and contrast licensing and subcontracting.

Answered: 1 week ago