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
o-na [289]
3 years ago
5

/*Implement a class Address . An address has a house number, a street, an optional

Computers and Technology
1 answer:
Ludmilka [50]3 years ago
8 0

Answer:

Java.

Explanation:

public class Address {

   int houseNumber;

   String street;

   int apartmentNumber;

   String city;

   String state;

   int postalCode;

   public Address(int houseNumber, String street, String city, String state, int postalCode) {

       this.houseNumber = houseNumber;

       this.street = street;

       this.city = city;

       this.state = state;

       this.postalCode = postalCode;

   }

   public Address(int houseNumber, String street, int apartmentNumber, String city, String state, int postalCode) {

       this(houseNumber, street, city, state, postalCode);

       this.apartmentNumber = apartmentNumber;

   }

   public void printAddress() {

       System.out.printf("Street: %s%n", this.street);

       System.out.printf("City: %s, State: %s, Postal Code: %d.%n", this.city, this.state, this.postalCode);

   }

   public boolean comesBefore(Address other) {

       if (this.postalCode < other.postalCode) {

           return true;

       }

       else {

           return false;

       }    

   }

}

The few changes I made are in bold.

You might be interested in
Proponents of Internet freedom see its _____________ as providing protection for unpopular expression; proponents of greater Int
diamong [38]

Answer:

anonymity

Explanation:

<h2><u>Fill in  the blanks </u></h2>

Proponents of Internet freedom see its <u>anonymity </u>as providing protection for unpopular expression; proponents of greater Internet control see it as the Internet's greatest danger.

6 0
3 years ago
Which of these is the longest geologic time frame?
snow_lady [41]
The largest geologic time frame is Eon.
4 0
3 years ago
Read 2 more answers
Design a program using ordinary pipes in which one process sends a string message to a second process, and the second process re
Dmitry [639]

Here's a solution in C#. Create two console applications, one for the client and one for the server. In the server, put this:

           Console.WriteLine("Listening to pipe...");

           var server = new NamedPipeServerStream("BrainlyPipe");

           server.WaitForConnection();

           var reader = new StreamReader(server);

           var writer = new StreamWriter(server);

           while (true)

           {

               var line = reader.ReadLine();

               if (!server.IsConnected) break;

               Console.WriteLine("Received: " + line);

               writer.WriteLine(ChangeCase(line));

               writer.Flush();

           }

To change case, add this function:

       public static string ChangeCase( string s)

       {

           var sb = new StringBuilder();

           foreach(char c in s)

               sb.Append(char.IsUpper(c) ? char.ToLower(c) : char.ToUpper(c));

           return sb.ToString();

       }

In the client, put this:

           var client = new NamedPipeClientStream("BrainlyPipe");

           client.Connect();

           var reader = new StreamReader(client);

           var writer = new StreamWriter(client);

           writer.WriteLine("Brainly question 13806153 demo");

           writer.Flush();

           Console.WriteLine(reader.ReadLine());

           Console.ReadLine();


5 0
3 years ago
Laura is in the middle of making a presentation. On one slide, she includes a heading, three subheadings, and three bullet point
Nat2105 [25]

The first one us d....


6 0
3 years ago
Read 2 more answers
What is the output of this code sequence? (Be exact in your answer with spacing) double [] a = {12.5, 48.3, 65.0}; System.out.pr
kolbaska11 [484]

Answer:

48.3

Explanation:

double [] a = {12.5, 48.3, 65.0}; This line creates the array a, which has three values, those three values can be accesed with the index operator, [].

System.out.println(a[1]); This line prints in the console the value in the array a in the second position, in Java the index inside arrays starts from zero, then puts a new line.

6 0
4 years ago
Other questions:
  • If she presses the left arrow , what will happened
    15·1 answer
  • A haiku is a three-line poem in which the first line contains five syllables, the second line contains seven syllables, and the
    12·1 answer
  • Mr. Perry has bookmarked a large number of webpages in Chrome while researching class topics. Unfortunately, he's bookmarked so
    13·1 answer
  • Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
    12·1 answer
  • WHICH OF THESE IS A TYPE OF ETHERNET <br> 802.11AC <br> 1000BASET <br> 4G
    7·1 answer
  • Columns are labeled with letters and Rows are labeled with numbers.
    5·1 answer
  • Which of the following best describes
    13·1 answer
  • Clicking the ____ opens the insert function dialog box.
    13·1 answer
  • URGENT!!!
    9·1 answer
  • Use the following flowchart to implement a simple application that will help students decide whether computer science is a good
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!