1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
quester [9]
3 years ago
9

Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Sto

re the data in an object designed to store a first name (string), last name (string), and postal code (integer). Assume each line of input will contain two strings followed by an integer value, each separated by a tab character. Then, after the input has been read in, print the list in an appropriate format to the screen.
Computers and Technology
1 answer:
Vikki [24]3 years ago
3 0

Answer:

Kindly go to the explanation for the answer.

Explanation:

Person.java

public class Person{

private String firstName, lastName;

private int zip;

public Person(String firstName, String lastName, int zip) {

super();

this.firstName = firstName;

this.lastName = lastName;

this.zip = zip;

}

public String toString() {

String line = "\tFirst Name = " + this.firstName + "\n\tLast Name = " + this.lastName;

line += "\n\tZip Code = " + this.zip + "\n";

return line;

}

}

Test.java

import java.util.ArrayList;

import java.util.Scanner;

public class Test{

public static void main(String args[]) {

Scanner in = new Scanner(System.in);

ArrayList<Person> al = new ArrayList<Person>();

for(int i = 0; i < 25; i++) {

System.out.print("Enter person details: ");

String line = in.nextLine();

String words[] = line.split("\t");

String fname = words[0];

String lname = words[1];

int numb = Integer.parseInt(words[2]);

Person p = new Person(fname, lname, numb);

al.add(p);

}

for(int i = 0; i < 25; i++) {

System.out.println("Person " + (i + 1) + ":");

System.out.println(al.get(i));

}

}

}

You might be interested in
If a menu-driven program uses a loop to redisplay the menu after a selected operation has been performed, the menu should probab
tangare [24]
That the user can select to either reset the options, or go back to a previous screen, if you can show me options ill tell you which one.
7 0
3 years ago
The number of colors in a bitmap image determines which category the image will be in. Complete the following sentences.
Jobisdone [24]

Answer:

Explanation:

1.Grayscale

2.Multitone

7 0
4 years ago
Is ROBLOX for kids?<br><br> A: Yes<br><br> B: No
Annette [7]
ROBLOX is for everyone
8 0
4 years ago
Read 2 more answers
Your digital footprint says a lot about you, but not everything is true or accurate. When you're a high school or college studen
Aleks [24]

Answer:

yes

Explanation:

cuz im yearz old

7 0
3 years ago
which of the following would help a new administrator quickly determine if a network has a vlan for its publicly accessible serv
Alexxx [7]

Answer:

Logical Network Diagrams.

Explanation:

Network Diagrams is the visual diagram that represents the networking of telecommunications and computer. <u>There are two types of network diagrams- Physical and Logical.</u>

Logical Network Diagram represents the information that flows through a network. The diagrams shown in the logical network diagram are routers and firewalls, VLAN Ids, IP address, traffic flow, etc. Logical Network Diagram is helpful in troubleshooting.

<u>Logical Network Diagram helps in determining whether a network has VLAN for public assessing or not</u>.

So, the correct answer is the Logical Network Diagram.

3 0
3 years ago
Other questions:
  • The equation y=2x+1 represents a function true or false
    11·1 answer
  • Technician A says copper has a low resistance. Technician B says the length of wire doesn't affect resistance. Who is correct?
    11·1 answer
  • Public static void prefixmerge(customer[] list1, customer[] list2, customer[] result {
    6·1 answer
  • Using C++, Write a full class definition for a class named Acc1, containing no constructors, functions, or data members (i.e., a
    12·2 answers
  • Do you think technology and social media have made it easier or more difficult to make connections and find a job? Explain.
    12·1 answer
  • Which should be your first choice for the most efficient and successful job search method?
    10·1 answer
  • State the seven common measures of queuing system performance ? State the assumptions of the “basic” single-server queuing model
    10·1 answer
  • Match the installation type to its description.
    9·1 answer
  • Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
    11·1 answer
  • (50 POINTS)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!