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
The natural functions of Earth seem all _____ in one way or another.
Sonja [21]
Would it be Similar ?
4 0
3 years ago
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
2 years ago
The _______ displays the data series in separate columns side-by-side so that you can compare the relative heights of the column
k0ka [10]

Answer:

Cluster Column Charts.

Explanation:

Clustered column chart:-It displays multiple data series in separate vertical columns. Each series have the same axis labels.Clustered vertical columns thus allow direct comparison of multiple data series.When having three data series you can compare their heights also.So we conclude the answer is Cluster Column Charts.

3 0
3 years ago
Read 2 more answers
Declarative knowledge refers to statements of fact.
d1i1m1o1n [39]

The statement “Declarative knowledge refers to statements of fact” is TRUE.

The statement “Imperative knowledge refers to 'how to' methods” is also TRUE.

I am hoping that these answers have satisfied your queries and it will be able to help you in your endeavors, and if you would like, feel free to ask another question.

7 0
3 years ago
Solve for x<br><br>4d+3/8=-2​
Alexxx [7]

Answer:

-19/32

Explanation:

(If I assume d to be x)

4x+3/8=-2

or,4x=-2-3/8=-19/8

or,x=(-19/8)*(1/4)=-19/32

5 0
2 years ago
Other questions:
  • This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given
    9·1 answer
  • Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
    12·1 answer
  • In a flow chart, both the decision structure and the repetition structure use the diamond symbol to represent the condition that
    9·1 answer
  • function calculate () { var s = 2; var x = 2; var y = 3; if (x &gt; 4) { s=s+ 2; } else if ( y &gt; 4) { s=s+ 4; } else { s+=3;}
    11·1 answer
  • Hello. I have an app which doesn't let me get in. It says: "wrong app info". I'm in a samsung device. How can I solve that probl
    13·2 answers
  • Assume we are using the simple model for floating-point representation as given in this book (the representation uses a 14-bit f
    7·1 answer
  • What is the difference between RELIABLE and UNRELIABLE sources of<br> income?
    7·2 answers
  • Can someone please help me answer the extension activity and the exit ticket. I’ll award you. Thanks❤️.
    12·1 answer
  • How is kerning used in Word?
    7·1 answer
  • Difference between multi-national and global company​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!