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
In a black box model are the customers told that they should be expecting to be haxked?
Licemer1 [7]
Uhhhhhhhhhhh maybe tbh i have noooo idea.
6 0
3 years ago
Weak Induction
slega [8]

Answer:

Following are the answer to this question:

Explanation:

In option 1:

The value of n is= 7, which is (base case)

\to 3^7

when n=k for the true condition:

\to 3^k

when n=k+1 it tests the value:

\to 3^{(k+1)}= 3^k,3\\\to < (k!) 3 \ substituting \ equation \\\to

since k>6  hence the value is KH>3 hence proved.

In option 2:

when:

for n=1:(base case)

\log(1!)

0<=0 \\ condition is true

when the above statement holds value n=1

when n=k

\log(k!)

when n=k+1

\log(k+1)!=\log(k!)+\log(k+1)\\

             

\because k \log k      [\therefore KH>K \Rightarrow  \log(KH>\loK)]

In option 3:

when n=1:

A_1 \cup B=A_1 \cup B\\\\

when n=k

\to (A_1\cap A_2 \cap.....A_k) \cup B\\=(A_1\cup B) \cap(A_2\cup B_2)....(A_k \capB).....(a)\\\to n= k+1\\ \to (A_1\cap A_2 \cap.....A_{kH}) \cup B= (A_1\cup B)\\\\\to  [(A_1\cap A_2 \cap.....A_{k}) \cup B]\cap (A_{KH}\cup B)\\\\\to  [(A_1\cup B) \cap (A_2 \cup B) \cap (A_3\cup B).....(A_k\cup B)\cap (A_{k+1} \cup B)\\\\  \ \ \ \ \ \ substituting \ equation \ a \\\\

hence n=k+1 is true.

7 0
3 years ago
Mrs. Golden wanted to collect baseline data on how often Lauren speaks to her neighbors during silent reading. He divided the 15
Mila [183]

Answer:

Interval Recording

Explanation:

According to my research on different data collection methods, I can say that based on the information provided within the question this method of data collection is called Interval Recording. This refers to the process of collecting different pieces of data from different parts of the same interview or study. Which is what Mrs. Golden is doing.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
What single awk command can be used to display all the login names and their associated numerical user IDs
Luden [163]

Answer:

Used the command syntax; awk -F":" '{ print "username: " $<number location> "\t\tuid:" $<number location> }' <target folder>

Explanation:

Linux operating system is a fast open-source computer platform for programmers and network administrators. Its system is arranged in a hierarchical tree structure with the root represented as "/" (for absolute path).

The passwd is a folder in the Linux OS that holds the login details of all users in the system network. The 'awk' is one of the commands used to get information from a file in a folder. It prints out the result by specifying the location of the values (like the username and user id) as a variable (with prefix '$') and then the target folder.

8 0
3 years ago
The class attribute a. can be applied to only one element in an HTML document b. determines the copy that will be displayed when
Nuetrik [128]

Answer:

The answer is likely C. "Can be used by CSS to apply the same formatting to more than one HTML element."

Explanation:

Given that the name of the attribute is "class," it sounds like the kind of code that would be applied to multiple elements intended to display something a specific way.

Qualification:

I've invested hours of my time into learning HTML, but I've never dealt with the "class" attribute. So, maybe take my answer as a grain of salt.

4 0
3 years ago
Other questions:
  • The Modified Greiss chemical test is used to detect the presence of what chemicals that indicate muzzle to target distance?
    11·1 answer
  • Peripherals can be used to input information. True False
    6·2 answers
  • Which of the following are types of home internet service? Check all that apply
    7·1 answer
  • Technician A says that the ECT and IAT sensors can be tested by using a digital multimeter or a scan tool. Technician B says tha
    12·1 answer
  • A ________ is a member function that is automatically called when a class object is
    6·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • In Outlook 2016, the Tell Me function can be accessed by
    15·2 answers
  • 8.
    9·1 answer
  • The Western Siberian Plain is __________ in some places because it has poor natural draining systems.
    15·1 answer
  • How ict tools changed the way we live explain it​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!