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
Which of these is a Microsoft certification CCIE PMP PRINCE2 MCSE
Angelina_Jolie [31]

MCSE is a Microsoft Certified Solutions Expert.

6 0
3 years ago
Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you: Will the printer work
Greeley [361]

Answer:

Yes, is should work

Explanation:

USB is widely adopted and supports both forward and backward compatibility. The USB 3.0 printer should work with the USB 2.0 computer. However, having a connection like this, the printer will only be able to work at the speeds of the computer’s USB 2.0. By default, USB is built to allow transfer speeds improvement with upgrades from previous generations while still maintaining compatibility between devices that are supported by them.

4 0
3 years ago
Encryption that uses 16-character keys is known as ____. strong 128-bit encryption strong 256-bit encryption military-strength 5
allsm [11]

Answer: Strong 128-bit encryption.

Explanation: An individual character corresponds to 8 bits . So if there are 16 characters then,

16\times8=128 bits keys

This makes the 128 bit key encryption the strongest amongst all other options.It is strongest because it is almost impossible to decode the 128-character key  by any method e.g.-brute-force method.

Other options are incorrect because the characters given by the other bits are as follows:  {\frac{256}{8}=32 characters

                         {\frac{512}{8}=64 characters

                         {\frac{512}{8}=128 characters  

Thus, the strongest character key is of 128 bits. for cipher.

3 0
3 years ago
A picture drawn in 3 d is called?​
Varvara68 [4.7K]

Answer:

autostereogram

Explanation:

that^

6 0
3 years ago
Read 2 more answers
(EASY)
AnnyKZ [126]
If you go to a college website you will see the it has .edu in the URL extensions.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Once your hard drive is installed what needs to be done to the drive and what do these two tasks do
    12·1 answer
  • If you wanted to search for emails containing the word advanced and prevent emails containing the word new from appearing in the
    14·1 answer
  • If I want to have an estimate of the number of people who visited my website, which metric should I use?
    5·2 answers
  • Anyone free to inbox me plz....​
    6·2 answers
  • All nuclear energy results in the rapid release of energy, such as in atomic bombs. true or false
    8·1 answer
  • A score of 3 or better on the exam administered at the end of which type of course usually means that you will earn college cred
    6·1 answer
  • Find the smallest value of n such that LCM of n is 15 is 45​
    5·1 answer
  • Help!!
    15·1 answer
  • NEED HELP ASAP!!!
    10·1 answer
  • Mario is designing a page layout for a sports magazine, and he decides to add the image of a cyclist. Which principle of page la
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!