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
How r u<br> ;)<br> happy what day is it
Ivahew [28]

Answer:

o

dw

Explanation:

5 0
2 years ago
Read 2 more answers
Software that communicates with the hardware and allows other programs to run. It is comprised of system software, or the fundam
alukav5142 [94]

Answer:An operating system, or "OS," is software that communicates with the hardware and allows other programs to run. It is comprised of system software, or the fundamental files your computer needs to boot up and function.

Explanation:

8 0
2 years ago
What is the digital divide? What does the digital divide mean for the world?
Luda [366]

it mean for some people that have technology like a computer and there are some who don't have access to technology like phones, and tv's

8 0
3 years ago
Is mmorpg an example of virtual community
Inga [223]
Yes I would say it is.
4 0
3 years ago
Read 2 more answers
Which of these devices is usually the default for most home network?
lora16 [44]

Answer:

there are no mutiple choices

5 0
3 years ago
Other questions:
  • Which of the following can you NOT apply for at any FLHSMV office? A. Certificate of title B. License plates C. Vehicle registra
    15·2 answers
  • You use a ____ following the closing brace of an array initialization list.
    12·2 answers
  • A(n) ______ is a type of collaborative website that allows users to create, add, modify, or delete website content.
    12·1 answer
  • Using computer software, compare the 2016 year-to-date sales through February to the 2017 year-to-date sales through February fo
    15·1 answer
  • In the ____________________ approach, the project is initiated by upper-level managers who issue policy, procedures and processe
    8·1 answer
  • How is the internet made?
    7·1 answer
  • The CMS Quarterly Provider Update (QPU) is an online CMS publication that contains information about __________ currently under
    14·1 answer
  • Write a class named Car that has the following fields: yearMode1. The yearModel field is an int that holds the car's year model.
    6·2 answers
  • Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w
    9·1 answer
  • Choose the correct answer
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!