subject
Computers and Technology, 20.02.2020 08:32 cmaya

/*Implement a class Address . An address has a house number, a street, an optional
apartment number, a city, a state, and a postal code. Supply two constructors: one
with an apartment number and one without. Supply a print method that prints the
address with the street on one line and the city, state, and zip code on the next line.
Supply a method public boolean comesBefore(Address other) that tests whether this
address comes before another when the addresses are compared by postal code.*/

public class P8_04 {
int houseNumber;
String street;
int apartmentNumber;
String city;
String state;
int postalCode;

public P8_04(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 P8_04(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 House number: %s \n", this. street, this. houseNumber);
System. out. printf("City: %s State: %s Postal Code: %d\n", this. city, this. state, this. postalCode);
}

public boolean comesBefore(P8_04 other) {
if (this. postalCode < other. postalCode) {
return true;
} else {
return false;
}
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:20
This problem has been solved! see the answeran evil king has a cellar containing n bottles of expensive wine, and his guards have just caught a spy trying to poison the king’s wine. fortunately, the guards caught the spy after he succeeded in poisoning only one bottle. unfortunately, they don’t know which one. to make matters worse, the poison the spy used was very deadly; just one drop diluted even a billion to one will still kill someone. even so, the poison works slowly; it takes a full month for the person to die. design a scheme that allows the evil king to determine exactly which one of his wine bottles was poisoned in just one month’s time while expending at most o(logn) of his taste testers.you are not allowed to use n testers, one for each bottle, and see which one tester dies after 30 days.(no pseudocode needed. just answer in words, how many testers you use, how you use them and why you correctly identify the poisoned bottle in 30 days)
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
question
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
question
Computers and Technology, 24.06.2019 21:00
Which device has the most limited computing functionality?
Answers: 1
You know the right answer?
/*Implement a class Address . An address has a house number, a street, an optional
apartment...
Questions
Questions on the website: 13722363