JAVA Programming Write a class Internal Revenue Service (IRS) that performs audi
ID: 3905724 • Letter: J
Question
JAVA Programming
Write a class Internal Revenue Service (IRS) that performs audits for customers. Use the Scanner class to prompt auditors for the audit requirements, which are based on the following scenarios: if the customer provided a W-2, if the customer provided receipts for donations, and if the customer deducted more than three children. The charges for these infractions are as follows: No W-2 - $500.00. No receipts - $300.00. Child deductions greater than three - If the other two infractions are presented, this charge is $1,000.00. The IRS class should provide a pass/fail status and create a bill.
Explanation / Answer
import java.io.*;
import java.util.*;
public class IRS{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("W-2(y/n):");
String w2 = sc.nextLine();
System.out.println("Receipts give(y/n):");
String receipt = sc.nextLine();
System.out.println("Child decuctions given(y/n):");
String cd = sc.nextLine();
if (w2.equals("n")){
System.out.println("Bill amount: $500");
}
else {
if (receipt.equals("n")){
if (cd.equals("y")){
System.out.println("Bill amount: $1000");
}
else {
System.out.println("Bill amount: $0");
}
}
else {
System.out.println("Bill amount: $300");
}
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.