Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with this Item: Please answer fully for the entire points and five s

ID: 3537608 • Letter: I

Question

I need help with this Item: Please answer fully for the entire points and five star rating.


New Content for Week 4:

The customer information that the customer must enter that should be validated includes the following:

In this assignment, you will add error handling to make sure the customer is filling in all of the required information. Then, you will output the order information to a file. Finally, you will read this file to display the order confirmation information on the screen to the customer.

Explanation / Answer

public static void main(String[] args){

FileWriter file=new FileWriter("Customer Information");

System.out.println("Enter y if you are returning cutsomer else enter n");

Scanner in=new Scanner(System.in);

if(in.next()!=y||in.next()!=n)

Exception e=new Exception(IncorrectInputException);

try{

file.write(in.next());

}catch(e){e.printstacktrace();}

System.out.println("Enter user name");

file.write(in.next());


System.out.println("enter at least 1 product to order");

   Exception e=new Exception(ZeroException);

try{

file.write(in.next());

}catch(e){e.printstacktrace();}


System.out.println("enter quantity");

Exception e=new Exception(outofboundsException);

try{

file.write(in.next());

}catch(e){e.printstacktrace();}


System.out.println("enter delivery address that includes street,city,sttae,zip");

file.write(in.next());

Exception e=new Exception(NotaNumberException);

try{

file.write(in.next());

}catch(e){e.printstacktrace();}

}