Question

In: Computer Science

In this assignment you are developing a fraud detection system to detect fraudulent activities based on...

In this assignment you are developing a fraud detection system to detect fraudulent activities based on this Decision Three. Your program receives a comma separated transaction log with the below format as its input:

[amount],[# of transactions in last day],[area code],[transaction time]

Your program should use string operations to decompose the transaction log and store its elements in variables of appropriate types. Then, based on the values of those attributes and the decision three, it attaches either a ",fraud" or ",no fraud" at the end of the transaction log and prints it to the console. (Note: Assume that the area code can only be 31451,42683,90902,10267

For example, if the input is:

1000,4,90902,0602

The output will be:

1000,4,90902,0602,no fraud

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);

/* Type your code here. */
  
int amount;
int noOfTransactions;
int areaCode;
String transactionTime;
  
}
}

Solutions

Expert Solution

Hi, please find the code for it below, and let me know in case of any doubts:

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scnr = new Scanner(System.in);

        System.out.println("Please enter the transaction log: ");

        String log = scnr.next();

        String arr[] = log.split(",");

        int amount;

        int noOfTransactions;

        int areaCode=0;

        String transactionTime;

        if(arr.length>0)

            amount = Integer.parseInt(arr[0]);

        if(arr.length>1)

            noOfTransactions=Integer.parseInt(arr[1]);

        if(arr.length>2)

            areaCode = Integer.parseInt(arr[2]);

        if(arr.length>3)

        transactionTime = arr[3];

       

        if(areaCode==31451 ||areaCode==42683 || areaCode==90902 ||areaCode==10267) {

            log=log+",no fraud";

        }

        else {

            log=log+",fraud";

        }

       

        System.out.println(log);

    }

}

sample outputs :


Related Solutions

What is Fraud Detection and how can Decision Tree be used to discover and prevent Fraudulent...
What is Fraud Detection and how can Decision Tree be used to discover and prevent Fraudulent Activity?
Describe the various fraud detection methods used by auditors and forensic accountants to uncover fraudulent activity.
Describe the various fraud detection methods used by auditors and forensic accountants to uncover fraudulent activity.
How do you detect billing scheme fraud
How do you detect billing scheme fraud
i have a drowning detection system composed of waist belt which includes multiple sensors to detect...
i have a drowning detection system composed of waist belt which includes multiple sensors to detect drowning what sensors can we use? can you give me sugestions with details please and can we use heartbeat sensor ? will it be able to detect heartbeats of the swimmer while being inside the belt ?
The IRS currently uses Benford's Law to detect fraudulent tax data. Suppose you work for the...
The IRS currently uses Benford's Law to detect fraudulent tax data. Suppose you work for the IRS and are investigating an individual suspected of embezzling. The first digit of 162 checks to a supposed company are as follows: Digit 1 2 3 4 5 6 7 8 9 Observed Frequency 46 32 20 21 13 12 6 2 10 What is the P-Value? Report answer to 4 decimal places P-Value = Write a statement to the law enforcement officials that...
1. List some controls that reduce fraud risks. 2. Explain how you can detect fraud
  1. List some controls that reduce fraud risks. 2. Explain how you can detect fraud.
Assume that you are the developer who is responsible to develop a Plagiarism Checking Tools for essay / written text based assignment system for the teaching instructor to detect any possible plagiarism case by automation
Read the question below and please Note : Make a design, Sketch and show the Algorithm also of the text based searching / filtering algorithm Assume that you are the developer who is responsible to develop a Plagiarism Checking Tools for essay / written text based assignment system for the teaching instructor to detect any possible plagiarism case by automation . Design and sketch a pseudocode of the text based searching / filtering algorithm . Take note that the algorithm...
Differentiate between the auditors' responsibilities to detect errors, fraud, and illegal acts. How would you assess...
Differentiate between the auditors' responsibilities to detect errors, fraud, and illegal acts. How would you assess the ethics of a company that has experienced each event with respect to motivation and the integrity of those who go along with such events?
How can you develop a qualitative lateral flow system for the detection of blood, using a...
How can you develop a qualitative lateral flow system for the detection of blood, using a nitrocellulose membrane, plus monoclonal and polyclonal anti-human ihG? What is the method, step by step, for developing a qualitative lateral flow test for detecting blood, using mono and polyclonal anti-human igG and a nitrocellulose membrane and pads etc?
How might you try to detect if your employee is gaming the incentive system? Try to...
How might you try to detect if your employee is gaming the incentive system? Try to think of concrete examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT