The Vernon Hills Mail Order Company often sends multiple packages per order. For each customer order, output a mailing label for each box to be mailed. The mailing labels contain the customer's complete name and address, along with a box number in the form Box 9 of 9. For example, an order that requires three boxes produces three labels: "Box 1 of 3", "Box 2 of 3", and "Box 3 of 3". Produce enough mailing labels for each order.

Required:
Developed a pseudocode that accomplished the logic and continued to process label requests until EOF was reached on the input file. This time, we will prompt the user to tell us when he or she is done and no further labels are needed.

Respuesta :

Answer:

See Explaination

Explanation:

Label.java:

import java.util.*;

public class Label {

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner in=new Scanner(System.in);

String title,firstName,lastName,streetAddress,city,state,zip,enterAnother;

int numBoxes,count;

enterAnother = "Y";

while(enterAnother.equals("Y") || enterAnother.equals("y"))

{

System.out.println("Enter title Mr./Ms./Mrs.");

title=in.nextLine();

System.out.println("Enter the first name: ");

firstName=in.nextLine();

System.out.println("Enter the last name: ");

lastName=in.nextLine();

System.out.println("Enter the street Address: ");

streetAddress=in.nextLine();

System.out.println("Enter the city: ");

city=in.nextLine();

System.out.println("Enter the state: ");

state=in.nextLine();

System.out.println("Enter the zip : ");

zip=in.nextLine();

System.out.println("Enter the number of boxes: ");

numBoxes=in.nextInt();

count=1;

while(count<=numBoxes)

{

System.out.println();

System.out.println(title+". "+firstName+" "+lastName);

System.out.println(streetAddress);

System.out.println(city+", "+state+", "+zip);

System.out.println("Box "+count +" of "+numBoxes);

System.out.println();

count+=1;

}

in.nextLine();

System.out.println("Do you want to enter another? (Y/y): ");

enterAnother=in.nextLine();

}

}

}