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
k0ka [10]
3 years ago
12

Write the AddressList method newBusiness. This method searches addresses for an existing business with an identical address (i.e

. an address object for which street matches st and number matches no). If this is found, then the method updates the item in the list to an address with name nm, street st and number no. If no entry with a matching street and number exists, then the method adds a new address to the end of the list with name nm, street st and number no. The method should return the index on Addresses where the address has been updated or added.
Business
1 answer:
max2010maxim [7]3 years ago
5 0

Answer:

See explaination

Explanation:

// Address.java

public class Address {

/**

* The name of the business

*/

private String name;

/**

* The name of the street the business is on

*/

private String street;

/**

* The street number of the business

*/

private int number;

/**

* Constructs an Address that represents a business with name nm,

* at number no on the street st

*/

public Address(String nm, String st, int no)

{

name = nm;

street = st;

number = no;

}

/**

* Returns the name of the business

*/

public String getName()

{

return name;

}

/**

* Returns the name of the street on which the business is located

*/

public String getStreet()

{

return street;

}

/**

* Returns the street number of the business

*/

public int getNumber()

{

return number;

}

}

//end of Address.java

//AddressBook.java

import java.util.ArrayList;

import java.util.List;

public class AddressBook {

/**

* The list of business addresses. No two businesses in the list

* can have the same address (both the same street and street number)

*/

private List<Address> addresses;

/**

* Constructs an empty AddressBook

*/

public AddressBook()

{

addresses = new ArrayList<Address>();

}

/**

* atparam st the name of a street

* atreturn a list with the names of each business with an address on that street

*/

public List<String> onStreet(String st)

{

// create an empty output list of names of business

List<String> businessName = new ArrayList<String>();

// loop over the list of addresses

for(int i=0;i<addresses.size();i++)

{

// if ith street of address = nm, add the name of the business to the output list

if(addresses.get(i).getStreet().equalsIgnoreCase(st))

businessName.add(addresses.get(i).getName());

}

return businessName; // return the list

}

/**

* Searches for an existing business with an identical address (street and number

* both match). Updates the record to an address with name nm, street st and number no.

* If no entry already exists adds a new address to the end of the list with these parameters.

*

* atparam nm the name of the business

* atparam st the street the business is on

* atparam no the street number of the business

* atreturn the index of where the business address is on the list

*/

public int newBusiness(String nm, String st, int no)

{

// loop over the list of addresses

for(int i=0;i<addresses.size();i++)

{

// if ith index addresses match the street and number of the input st and no

if((addresses.get(i).getStreet().equalsIgnoreCase(st)) && (addresses.get(i).getNumber() == no))

{

addresses.remove(i); // remove the ith address from list

addresses.add(i, new Address(nm,st,no)); // add a new address with the input name, street and number at ith index

return i; // return the index i

}

}

// if no address match, add the business at the end of the list

addresses.add(new Address(nm,st,no));

return addresses.size()-1; // return the last index

}

}

//end of AddressBook.java

You might be interested in
How does fractional reserve banking grow the economy?
Aleks [24]

Answer:

C. By allowing the same money to be both stored as a deposit and  loaned to businesses is the correct answer.

Explanation:

6 0
3 years ago
<img src="https://tex.z-dn.net/?f=%20%5C%3A%20%20%5C%3A%20%20%5C%3A%20%20%5C%3A%20%20%5C%3A%20%20%5C%3A%20" id="TexFormula1" tit
Novay_Z [31]

Answer:

market is a composition of systems, institutions, procedures, social relations or infrastructures whereby parties engage in exchange. While parties may exchange goods and services by barter, most markets rely on sellers offering their goods or services to buyers in exchange for money. It can be said that a market is the process by which the prices of goods and services are established. Markets facilitate trade and enable the distribution and allocation of resources in a society. Markets allow any trade-able item to be evaluated and priced. A market emerges more or less spontaneously or may be constructed deliberately by human interaction in order to enable the exchange of rights of services and goods. Markets generally supplant gift economies and are often held in place through rules and customs, such as a booth fee, competitive pricing, and source of goods for sale.

Explanation:

hope it helps.

have a great day

8 0
3 years ago
Read 2 more answers
They were totally excited to be getting a new system. It would allow them to conduct a remote discussion of the budget with the
slamgirl [31]

Answer:

The correct answer is letter "C": They were excited about the video conference system.

Explanation:

In order to make sentences more professional and direct, they must be objective. It implies any point of view, perspective, comment, or any subjective piece of information should be deleted so the statement is unbiased. By doing this, we avoid exaggerations or misunderstandings from the author.

In the sentence:

  • <em>They were </em><u><em>totally</em></u><em> excited to be getting a new system. </em>

We should delete "totally" which is an individual perception of the author. Then:

  • <em>They were excited about the video conference system.</em>

<em />

Will be a more objective sentence.

7 0
3 years ago
Gomez runs a small pottery firm. He hires one helper at $11,500 per year, pays annual rent of $7,000 for his shop, and spends $2
madreJ [45]

Answer:

in this problem, we need to calculate Gomez's accounting and economic profit. To do this, let us first classify and list the explicit and implicit costs. Revenue: Sales: $85,000 Explicit costs: Cost of one helper: $18,000 Rent: $8,000 Materials: $24,000 These are the costs that require an outlay of cash. Implicit costs: Opportunity cost of funds invested in equipment: $7,000 Gomez could have invested the funds in another asset that could earn him $7,000 Opportunity cost of working as a potter in his own shop: $20,000 Gomez could have worked as a potter for a competitor that could earn him $20,000. This is the worth of Gomez's skill as a potter. Entrepreneurial talent: $4,000 This is the worth of Gomez's talent in running the business. These costs do not require an outlay of cash. These are the implicit costs. Now, we are ready to calculate both the accounting and economic profit of Gomez. a. Calculate the accounting profit for Gomez's pottery firm. $_ Accounting profit = Total Revenue − Total Explicit Costs Accounting profit = $ 85 , 000 − ( $ 18 , 000 + $ 8 , 000 + $ 24 , 000 ) Accounting profit = $ 85 , 000 − $ 50 , 000 Accounting profit = $ 35 , 000 The accounting profit is equal to $35,000. b. Now calculate Gomez's economic profit. $_ Economic profit = Total Revenue − Total Explicit and Implicit Costs Economic profit = $ 85 , 000 − ( $ 18 , 000 + $ 8 , 000 + $ 24 , 000 + $ 7 , 000 + $ 20 , 000 + $ 4 , 000 ) Economic profit = $ 85 , 000 − $ 81 , 000 Economic profit = $ 4 , 000 The economic profit is equal to $4,000.

8 0
3 years ago
The total factory overhead for Martin Company is budgeted for the year at $375,000. Martin manufactures two garden products: a l
meriva

Calculation of total number of budgeted direct labor hours for the year:


It is given that Martin manufactures two garden products. These products each require four direct labor hours (dlh) to manufacture. Each product is budgeted for 2,500 units of production for the year.

Hence, the total number of budgeted direct labor hours for the year shall be = 2 Products *2500 units * 4 dlh = 20,000 dlh.



4 0
3 years ago
Other questions:
  • A covert operation is defined and in which the president has certified its importance to america's national security
    8·1 answer
  • International trade-dependent jobs have grown at a rate three times the growth of U.S.-dependent jobs.
    9·1 answer
  • Suppose a mutual fund qualifies as having moderate risk if the standard deviation of its monthly rate of return is less than 3​%
    12·1 answer
  • Seller offers to sell her home to a purchaser for $70,000.00. The purchaser responds that she will buy the home for $60,000.00.
    15·1 answer
  • Clark Company's master budget reflects budgeted sales information for the month of June, 2019, as follows: Budgeted Quantity Bud
    5·1 answer
  • On January 15, 2021, Vancey Company paid property taxes on its factory building for the calendar year 2021 in the amount of $1,0
    12·1 answer
  • Vincent and Jean are two cooks who work in a village. Each of them can either bake cakes or make pizzas. Every ingredient is rea
    6·1 answer
  • At the beginning of year 1, Looby Corp. purchases equipment for $100,000. The equipment has a residual value of $20,000 and an e
    14·1 answer
  • The Walt Disney Company is world renowned for its destination resorts and theme parks. The company prides itself on providing th
    7·2 answers
  • Zoe is a CEO of corporation she organized herself and the corporation has 15 shareholders the company operates in several States
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!