Write the code in python programming for the below problem. Introduction One useful data point in detecting fraud is the account history of a customer. For an account, we receive notification of purchases and, sometimes, reports of fraud. Typically, a prior report of fraud for an account would increase the perceived risk of fraud on future transactions. Similarly, a history of non-fraudulent purchases for an account would decrease the risk of fraud. A credit card holder has 90 days to report any fraudulent transactions with the card. So if an account has purchases over 90 days old and no reports of fraud, we assume that these older purchases were not-fraudulent. Problem Description The purpose of this programming problem is to determine the status of a customer account history at the time a new purchase is made. The input is a sequence of customer account events, in chronological order. Each event has three fields, all of which are of string type ,, For example: 2015-01-01,joe@signifyd.com,PURCHASE 2015-02-01,fraudster@fraud.com,FRAUD_REPORT There are two event types: 1. PURCHASE - indicates a purchase by this customer account on the specified date. 2. FRAUD_REPORT - indicates we received a report of fraud associated with this customer account. The specified date is that date that we received the report, not the date the fraud was committed. For each eventPURCHASE, we are interested in a summary of the customer account history based on prior events. The summary consists of the date of the summary, the customer account id, and a status. There are four possible values for the status of the customer account history: 1. NO_HISTORY - there are no prior events for this customer account 2. FRAUD_HISTORY - we have at least one event FRAUD_REPORT for this customer account. 3. GOOD_HISTORY- customer account has no FRAUD_REPORTs and at least one prior that PURCHASEis more than 90 days old. 4. UNCONFIRMED_HISTORY - customer account has no FRAUD_REPORTs and at least one priorPURCHASE but no PURCHASEs over 90 days old. For accounts with FRAUD_HISTORY, GOOD_HISTORY, and UNCONFIRMED_HISTORY, the status also contains a count of relevant events. ● FRAUD_HISTORY - count of FRAUD_REPORTs ● GOOD_HISTORY - count of priorsPURCHASE over 90 days old ● UNCONFIRMED_HISTORY- count of prior purchases. The output is expected to be in the same order as the input. Sample Input and Output For the following input: 2015-01-01,joe@signifyd.com,PURCHASE 2015-02-01,fraudster@fraud.com,FRAUD_REPORT 2015-02-03,fraudster@fraud.com,FRAUD_REPORT 2015-02-10,joe@signifyd.com,PURCHASE 2015-02-14,fraudster@fraud.com,PURCHASE 2015-03-15,joe@signifyd.com,PURCHASE 2015-05-01,joe@signifyd.com,PURCHASE 2015-10-01,joe@signifyd.com,PURCHASE The following output is expected. 2015-01-01,joe@signifyd.com,NO_HISTORY 2015-02-10,joe@signifyd.com,UNCONFIRMED_HISTORY:1 2015-02-14,fraudster@fraud.com,FRAUD_HISTORY:2 2015-03-15,joe@signifyd.com,UNCONFIRMED_HISTORY:2 2015-05-01,joe@signifyd.com,GOOD_HISTORY:1 2015-10-01,joe@signifyd.com,GOOD_HISTORY:4

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write the code in python programming for the below problem.

Introduction One useful data point in detecting fraud is the account history of a customer. For an account, we receive notification of purchases and, sometimes, reports of fraud. Typically, a prior report of fraud for an account would increase the perceived risk of fraud on future transactions. Similarly, a history of non-fraudulent purchases for an account would decrease the risk of fraud. A credit card holder has 90 days to report any fraudulent transactions with the card. So if an account has purchases over 90 days old and no reports of fraud, we assume that these older purchases were not-fraudulent.

Problem Description

The purpose of this programming problem is to determine the status of a customer account history at the time a new purchase is made. The input is a sequence of customer account events, in chronological order. Each event has three fields, all of which are of string type ,,

For example:

2015-01-01,joe@signifyd.com,PURCHASE

2015-02-01,fraudster@fraud.com,FRAUD_REPORT

There are two event types:

1. PURCHASE - indicates a purchase by this customer account on the specified date.

2. FRAUD_REPORT - indicates we received a report of fraud associated with this customer account. The specified date is that date that we received the report, not the date the fraud was committed. For each eventPURCHASE, we are interested in a summary of the customer account history based on prior events. The summary consists of the date of the summary, the customer account id, and a status. There are four possible values for the status of the customer account history:

1. NO_HISTORY - there are no prior events for this customer account

2. FRAUD_HISTORY - we have at least one event FRAUD_REPORT for this customer account.

3. GOOD_HISTORY- customer account has no FRAUD_REPORTs and at least one prior that PURCHASEis more than 90 days old.

4. UNCONFIRMED_HISTORY - customer account has no FRAUD_REPORTs and at least one priorPURCHASE but no PURCHASEs over 90 days old. For accounts with FRAUD_HISTORY, GOOD_HISTORY, and UNCONFIRMED_HISTORY, the status also contains a count of relevant events.

● FRAUD_HISTORY - count of FRAUD_REPORTs

● GOOD_HISTORY - count of priorsPURCHASE over 90 days old

● UNCONFIRMED_HISTORY- count of prior purchases. The output is expected to be in the same order as the input. Sample Input and Output For the following input:

2015-01-01,joe@signifyd.com,PURCHASE

2015-02-01,fraudster@fraud.com,FRAUD_REPORT

2015-02-03,fraudster@fraud.com,FRAUD_REPORT

2015-02-10,joe@signifyd.com,PURCHASE

2015-02-14,fraudster@fraud.com,PURCHASE

2015-03-15,joe@signifyd.com,PURCHASE

2015-05-01,joe@signifyd.com,PURCHASE

2015-10-01,joe@signifyd.com,PURCHASE

The following output is expected.

2015-01-01,joe@signifyd.com,NO_HISTORY

2015-02-10,joe@signifyd.com,UNCONFIRMED_HISTORY:1

2015-02-14,fraudster@fraud.com,FRAUD_HISTORY:2

2015-03-15,joe@signifyd.com,UNCONFIRMED_HISTORY:2

2015-05-01,joe@signifyd.com,GOOD_HISTORY:1

2015-10-01,joe@signifyd.com,GOOD_HISTORY:4

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY