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
As time goes on, technology is likely to _______. A. Increase in complexity b. Decrease in complexity c. Stay at the same comple
amid [387]

Answer:

The answer to this question is the option "A".

Explanation:

In this question, the answer is Increase in complexity because, In computer science, the computerized or simply complexity is an algorithm. In this algorithm, the number of the resource is required for moving it (a quality separate to “complexity” in a conventional reason). So in this question the answer is option A that is  Increase in complexity.

5 0
3 years ago
Which of the following is a key feature of a relational database?
Mekhanik [1.2K]

It uses primary keys and foreign keys as a means to provide efficient access to data and is supported directly in the database rather than maintained in the application code.

Explanation: Relational databases use an expressive query language, make efficient use of indexes within the database, ensure strong consistency, and fit well within an enterprise management system. Non-relational databases have a flexible data model, have high scalability, and performance, and have always-on global deployments.

3 0
1 year ago
computer has a 32-bit instruction word broken into fields as follows: opcode, six bits; two register file address fields, five b
lina2011 [118]

Answer:

a.  2^6, or 64 opcodes.

b.  2^5, or 32 registers.

c. 2^16, or 0 to 65536.

d.  -32768 to 32768.

Explanation:

a. Following that the opcode is 6 bits, it is generally known that the maximum number of opcodes should be 2^6, or 64 opcodes.

b. Now, since the size of the register field is 5 bits, we know that 2^5 registers can be accessed, or 32 registers.

c. Unsigned immediate operand applies to the plus/minus sign of the number. Since unsigned numbers are always positive, the range is from 0 to 2^16, or 0 to 65536.

d. Considering that the signed operands can be negative, they need a 16'th bit for the sign and 15 bits for the number. This means there are 2 * (2^15) numbers, or 2^16. However, the numbers range from -32768 to 32768.

6 0
3 years ago
Can someone write a 5 sentence summary about Virtual Assistants. Please. I'm in a rush. Personal problems.
Lyrx [107]
Virtual Assistants can be useful. Blind people can use them to be informed, browse the web, and learn new facts. They can make tasks quicker too. They can control things like your heater or air conditioner. But if one were to malfunction, it could take lives.
7 0
3 years ago
Consider the following code segment: theSum = 0.0 while True: number = input("Enter a number: ") if number == ": break theSum +=
Strike441 [17]

n where n is the number of chances user takes to enter a blank number and n>=1.

<u>Explanation:</u>

The loop starts with a universal condition where it is initialized using a true value. Hence the iteration count goes to 1. The user is asked to enter a number after 1st iteration. If number is a blank number, the loop is terminated, else the loop goes on until the users enters a blank number. Hence the iterations depend on the number of chances taken by the user to enter a blank number. Since the user is going to enter a number at least once, the minimum value of n will be 1.

4 0
3 years ago
Other questions:
  • Why does people that gets abused not report?
    5·1 answer
  • What is the role of the osi application layer? provides control of all the data flowing between the source and destination devic
    5·1 answer
  • .<br> 1. Press the _______ key to move to the next cell in a row.
    14·2 answers
  • Help what is a computer made from (computer class question)!!
    9·1 answer
  • Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet?
    15·1 answer
  • public interface Displayable { void display(); } public class Picture implements Displayable { private int size; public void inc
    14·1 answer
  • A form’s height is ______________________.<br><br> A property<br><br> A method<br><br> An event
    10·1 answer
  • Which operating system user interface does not reside on the computer but rather in the cloud on a web server?
    5·1 answer
  • !!!!!16 POINTS!!!!Can a computer evaluate an expression to something between true and false? Can you write an expression to deal
    7·1 answer
  • If you do not clean your hardware on a regular basis, which of these is most likely to be a problem?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!