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
Rickie gets a message from the school’s tech support department. Their computer is supposed to be running the latest system soft
raketka [301]

Answer:

the operating system or web browser

6 0
3 years ago
Read 2 more answers
The set of Visual Basic instructions that tells an object how to behave after an action by the user (such as clicking a button)
alexdok [17]

Answer:

Event procedure

Explanation:

Whenever a user perform certain action, such as press a button on the keyboard or click the mouse, etc. such action are called an event. when an event occurs, Visual Basic looks for BASIC instructions to tell the object in the program how to behave to the user event. The Visual Basic instructions that responds to this specific event is called an event procedure.

7 0
3 years ago
Why do people yeet yeet and ree
DiKsa [7]

Answer:

Cause they are trying to be annoying

Explanation:

Something is wrong with them :)

8 0
3 years ago
Read 2 more answers
Which Windows utilities are used to create previous versions of files that can be recovered from the file properties dialog box?
pochemuha

Answer:

File History utility and System Protection utility for windows 8;

And then Backup and Restore utility and System Protection utility for windows 7.

6 0
3 years ago
Size of a MAN can range from ​
Dovator [93]

Answer:

According to the latest CDC stats, these are the average heights for U.S. adult men based on age:

Ages 20 to 39: 176.1 centimeters

Ages 40 to 59: 175.8 centimeters

Age 60 and older: 173.4 centimeters

6 0
3 years ago
Other questions:
  • Fifty-three percent of U.S households have a personal computer. In a random sample of 250 households, what is the probability th
    11·1 answer
  • For local travel addresses and street names should be
    14·1 answer
  • ________ is a program that runs on a computer to manage and control a computer's activities.
    11·1 answer
  • What is the difference between an embedded image and an attached image
    7·2 answers
  • SOLVE IN C:
    10·1 answer
  • Assume Flash Sort is being used on a array of integers with Amin = 51, Amax = 71, N=10, m=5 Items are classified according to th
    6·1 answer
  • When you are making multiples of a brownie recipe, you cannot - without great difficulty - use a fraction of an egg. The calcula
    6·1 answer
  • 2. Which property is used for hiding text of the textbox?
    14·1 answer
  • Write a void method named myMethod which prints "This is a void method" (without the quotes). Your method should be declared pub
    5·1 answer
  • Write a statement to declare a variable x with data type int and initialise with the value 10​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!