Questions
Advanced Inheritance Concepts (Exercise 7) The Cullerton Park District holds a mini-Olympics each summer. Create a...

Advanced Inheritance Concepts (Exercise 7)

The Cullerton Park District holds a mini-Olympics each summer. Create a class named Participant with fields for a name, age, and street address. Include a constructor that assigns parameter values to each field and a toString() method that returns a String containing all the values. Also include an equals() method that determines two participants are equal if they have the same values in all three fields.

Create an application with two arrays of at least eight participants each—one holds participants in the mini-marathon, and the other holds participants in the diving competition. Prompt the user for participant values. After the data values are entered, display values for participants who are in both events.

Participant.java

public class Participant
{
// private variables here

public Participant(String n, int a, String add)
{
// constructor code here
}
public String getName()
{
// method code here
}
public int getAge()
{
// method code here
}
public String getAddress()
{
// method code here
}
public String toString()
{
// method code here
}
public boolean equals(Participant p)
{
// method code here
}
}

TwoEventParticipant.java

import java.util.*;
public class TwoEventParticipants
{
public static void main(String[] args)
{
Participant marathoners[] = new Participant[8];
Participant divers[] = new Participant[8];
int i, j;
String name;
int age;
String address;
Scanner input = new Scanner(System.in);
System.out.println("Enter mini-marathon participants");
for(i = 0; i < marathoners.length; ++i)
{
System.out.print("Enter name: ");
name = input.nextLine();
System.out.print("Enter age: ");
age = input.nextInt();
input.nextLine();
System.out.print("Enter address: ");
address = input.nextLine();
marathoners[i] = new Participant(name, age, address);
}
System.out.println("\nEnter diving participants");
for(i = 0; i < divers.length; ++i)
{
System.out.print("Enter name: ");
name = input.nextLine();
System.out.print("Enter age: ");
age = input.nextInt();
input.nextLine();
System.out.print("Enter address: ");
address = input.nextLine();
divers[i] = new Participant(name, age, address);
}   
System.out.println("\nParticipants who are in both events:");
for(i = 0; i < marathoners.length; ++i)
for(j = 0; j < divers.length; ++j)
if(marathoners[i].equals(divers[j]))
System.out.println(marathoners[i].toString());
}
}

Possible Answer:

Participants who are in both events:

Participant_2

10

Apartment No. 2

Participant_6

13

Apartment No. 6

Participant_7

13

Apartment No. 7

In: Computer Science

In 2017, Nobles Company paid $975,000 for real estate that included a tract of land on...

In 2017, Nobles Company paid $975,000 for real estate that included a tract of
land on which two buildings were located. The plan was to demolish Building A,
and build a new store in its place. Building B was to be used as a company
office, and was appraised to have a value of $315,000, with a useful life of 20
years, and a $45,000 scrap value. A lighted parking lot near Building B had
improvements valued at $105,000 that were expected to last another five years,
and have no salvage value. In its existing condition, the tract of land was
estimated to have a value of $630,000.

Nobles company incurred the following additional costs:
(a) Cost to demolish Building A, to make the Land useable............. $71,250
(b) Cost to landscape new building site............................................ $81,000
(landscaping was predicted to last 20 years, no scrap value)
(c) Cost to build new building (Building C) on former site of
Building A, having a useful life of 25 years, and a $75,000
scrap value.................................................................................. $1,125,000
(d) Cost of new land improvements for Building C, which have an
8-year useful life, and no scrap value.......................................... $187,500

i) Prepare a form having the following headings: Land, Building B, Building C,
Land Improvements B, and Land Improvements C. Allocate the costs
incurred by Noble Company to the appropriate columns and total each
column.
ii) Prepare a single journal entry dated July 1, 2017, to record all of the costs
incurred, assuming they were all paid in Cash.
iii) Prepare December 31, 2017, adjusting entries to record depreciation for the
months during 2017 that the assets were in use. Use straight-line
depreciation for your calculations.

In: Accounting

In 2017, GREEN CORPORATION acquired a silver mine in Benguet. Because the mine is located deep...

  1. In 2017, GREEN CORPORATION acquired a silver mine in Benguet. Because the mine is located deep in the Benguet mountains, Green was able to acquire the mine for the low price of P50,000.

In 2018, Green constructed a road to the silver mine costing P5,000,000. Improvements to the mine made in 2018 cost P750,000. Because of the improvements to the mine and the surrounding land, it is estimated that the mine can be sold for P600,000 when the mining activities are complete.

During 2019, five buildings were constructed near the mine site to house the mine workers and their families. The total cost of the five buildings was P1,500,000. Estimated residual value is P250,000. In 2017, geologists estimated 4 million tons of silver ore could be removed from the mine for refining.

During 2020, the first year of operations, only 5,000 tons of silver ore were removed from the mine. However, in 2021, workers mined 1 million tons of silver. During that same year, geologists discovered that the mine contained 3 million tons of silver ore in addition to the original 4 million tons. Improvements of P275,000 were made to the mine early in 2021 to facilitate the removal of the additional silver.

Early in 2022, an additional building was constructed at a cost of P225,000 to house the additional workers needed to excavate the added silver. This building is not expected to have any residual value.

In 2022, 2.5 million tons of silver were mined and costs of P1,100,000 were incurred at the beginning of the year for improvements to the mine.

Requirements:

  1. Depletion from 2020 to 2022.
  2. Depreciation from 2020 to 2022.

In: Accounting

Water will be pumped from a reservoir free surface of which is at an elevation of...

Water will be pumped from a reservoir free surface of which is at an elevation of “z1” to reservoir the free water surface of which is at “z2”. Both of the reservoirs’ free surfaces at atmospheric pressures.Design a piping system that transmits water from the lower reservoir to the upper reservoir at a volumetric flow rate of Q (m3 /h).

Q = 200 (m3/h) Za = 10(m) Zb= 60 (m) Zc = 75 (m) L1=200 (m) L2=125 (m) "Pipe material is "Commercial Stainless Steel" "

1) Consider necesssary fittings( valves, elbows….)

2) Given data and cost elements, determine the optimum pipe diameter of the system . In order to do this:

3) Write the energy equation between z1 and z2 by taking the major losses associated with the pipe, minor losses associated with the fittings, sudden contraction, and expansion regions inside the system and the pump total head rise ”hp” into account .

4) The average velocity of the water inside your piping system should be between 0.1 and 5 m/s. 5) Calculate the head rise “hp” that must be provided by the pump.

6) Choose a pump that provides a head rise of ”hp” (that you calculated) near its most efficient working flow rate at your given flowrate Q from the local manufacturer’s catalogues.

7) Find the cost of the pipe per one meter (TL/m) and unit electricity price ( TL/kWh). Neglect cost of the pump or pumps.

In: Mechanical Engineering

Gluth Company makes three paint products in a single facility. These products are produced and sold...

Gluth Company makes three paint products in a single facility. These products are produced and sold in 5 gallon units. Each has the following unit product costs: Products A B C Direct materials ......................................... $22.50 $22.40 $29.20 Direct labor ................................................ 13.60 11.40 12.50 Variable manufacturing overhead ............. 3.00 3.40 4.50 Total variable unit product cost ................. $39.10 $37.20 $46.20 Additional data concerning these products are listed below. Products A B C Mixing minutes per unit.............................. 3.30 1.70 1.80 Selling price per unit ................................... $84.70 $76.10 $87.50 Variable selling cost per unit ...................... $1.80 $2.40 $2.90 Monthly demand in units ............................ 4,000 2,000 4,000 Mixing machine time is limited in the production facility. A total of 21,000 minutes are available per month on these machines. Direct labor is a variable cost in this company. Fixed manufacturing overhead is $155,000 and fixed selling & administrative expenses are $62,000 per month. Question: A local company has additional mixing machine time available and is willing to rent time on one of its machines so that Gluth can satisfy customer demand for all products. The rental charge will cover all product related costs except direct materials; which must be provided by Gluth. Assuming Gluth has used its mixing machines in the most optimal fashion, what is the maximum amount they should be willing to pay the outside company for one additional hour of mixing machine time so as to not sell product at a loss? Round to the near

In: Accounting

It is a story of long struggle to establish a new business. Finally, the Shop-XP735 got...

It is a story of long struggle to establish a new business. Finally, the Shop-XP735 got its dream team of friendly staffs who are working together for years and the customer base of the shop has been developed through personal relationship built up over years between its staffs and customers. Team manager cannot think of running the shop without these staffs.

The owner of the Shop-XP735 is considering whether to buy a fully automatic production machine. Staffs of the shop are widely supportive of the purchase because it would eliminate a tedious part of their work. Accountant of the shop provides the following information to the owner.

> The cost, excluding installation cost of $1,060, for the automatic production machine is $24,859.

> Annual cost savings include labour cost of $3,199 and raw materials cost of $2,341 for 9 years.

> 8.4 per cent annual depreciation will increase depreciation expense by $1,014 per year for 9 years.

> The opportunity cost for the investment would be 12.5 per cent.

> Tax rate is 38 per cent.

Above information is leaked out to the staffs and they are in festive mood as the cost of machine is lower than the total savings of labour and materials cost in 9 years.

However, the owner is not happy with the numbers and she is planning to cancel the idea of buying the machine. Sensing the decision of Jim, his staff becomes highly demoralised and a few of them are even thinking of leaving the job.

In the final meeting to decide on this investment decision, two of the oldest staffs provide two surprising offers to the owner. One staff offers $4,009 salvage value for the machine after 9 years and the other staff offers a loan arrangement to pay he purchase price of the machine at 6 per cent interest so that the owner has to pay equal yearly instalments at the beginning of each year for 9 years.

Requirement: Show your calculations and then write a brief report (with supporting calculations) and make recommendations to either accept or reject the project with full explanations (including quantitative and qualitative factors). Discussion should include the impact of the offers made by staffs in the meeting.  

Please solve it with details, thank you

In: Accounting

Resource Usage and Supply, Activity Rates, Service Organization EcoBrite Labs performs tests on water samples supplied...

Resource Usage and Supply, Activity Rates, Service Organization

EcoBrite Labs performs tests on water samples supplied by outside companies to ensure that their waste water meets environmental standards. Customers deliver water samples to the lab and receive the lab reports via the Internet. The EcoBrite Labs facility is built and staffed to handle the processing of 100,000 tests per year. The lab facility cost $180,000 to build and is expected to last 10 years and will have no salvage value. Processing equipment cost $210,000 and has a life expectancy of five years and will have no salvage value. Both facility and equipment are depreciated on a straight-line basis. EcoBrite Labs has five salaried laboratory technicians, each of whom is paid $28,000. In addition to the salaries, facility, and equipment, EcoBrite Labs expects to spend $52,000 for chemicals and other supplies (assuming 100,000 tests are performed). Last year, 90,000 tests were performed.

Required:

1. Classify the resources associated with the water testing activity into one of the following types: (1) committed resources and (2) flexible resources.

committed resources: - Select your answer -Equipment, technician salaries and suppliesLab facility, equipment and chemicalsLab facility, equipment and suppliesLab facility, equipment and technician salariesItem 1  
flexible resources:      - Select your answer -Chemicals and suppliesEquipment, technician salaries and suppliesLab facility, equipment and chemicalsLab facility, equipment and suppliesLab facility, equipment and technician salariesItem 2

2. Calculate the total annual activity rate for the water testing activity. Break the activity rate into fixed and variable components. (Round your answers to three significant digits.)

Total water testing rate: $  per test
Variable activity rate: $  per test
Fixed activity rate: $  per test

3. Compute the total activity availability, and break this into activity output and unused activity.

Activity availability:   tests
Activity usage:   tests
Unused activity:   tests

4. Calculate the total cost of resources supplied, and break this into the cost of activity used and the cost of unused activity.

Cost of activity supplied: $
Cost of activity used: $
Cost of unused activity: $

In: Accounting

I know how to do this with arrays, but I have trouble moving my code to...

I know how to do this with arrays, but I have trouble moving my code to use with linked lists

Write a C program that will deal with reservations for a single night in a hotel with 3 rooms, numbered 1 to 3. It must use an infinite loop to read commands from the keyboard and quit the program (return) when a quit command is entered. Use a switch statement to choose the code to execute for a valid command. The valid commands are: R or r: reserve a room C or c: cancel a reservation W or w: remove a request from the waiting list L or l: list the current reservations for the night Q or q: quit the program Any other input: print an error message and prompt for another command.

You must use a linked list to represent the reservation list, and another linked list to represent the waiting list. You can determine whether each list will be singly- or doubly linked, and whether each list has just a front pointer, or a front and rear pointer. The two lists do not need to have the same design (that is one could be singly-linked with a front pointer, and the other doubly-linked with front and rear pointers. The reservation list can have at most as many nodes as there are rooms in the hotel Actions taken in response to a valid command (r, c, w, or l) must be implemented using programmer-defined functions, one per command. Any needed data must be passed to the functions, not declared globally. Implement reservation ids using a simple integer counter. Names will have fewer than 15 characters.

Actions for each command are:

Reservation: If there is a free room, reserve a room by inserting a node on the reservation list containing the next reservation id and the name associated with the reservation. When there is space available, print the reservation id for the person at the keyboard, and prompt for and read the name associated with the reservation. If there are no rooms, print an appropriate message and ask if the person wants to be entered on the waiting list. If they do, add a node to the waiting list array, print the reservation id for the person at the keyboard, and prompt for and read the name associated with the waiting list entry. The waiting list must be implemented as a queue (insert nodes at the back of the list and remove nodes from the front of the list when a room becomes available)

Cancellation: If there is a room reserved under that reservation id, cancel the reservation by removing the node associated with the reservation. Otherwise print a message that the id is not valid. If a room is cancelled and there are entries on the waiting list, remove the first entry on the waiting list and insert the data in the reservation list, then print a message indicating that reservation id is now confirmed. Note that, if the nodes on both lists are the same type, you can simply insert the node you removed from the waiting list into the reservation list.

Wait cancellation: If there is a waiting list entry with that reservation id, the node containing that reservation id should be removed from the waiting list. Otherwise print a message indicating that id is not on the waiting list.

List reservations: Print the reservation ids and associated names of all rooms that are reserved. Do not print anything for rooms that are vacant. If there are no rooms reserved, print a message indicating that. If there are any entries on the waiting list you should also print the reservation number and name of all elements on the waiting list.

Quit: end the program by returning from the main function. Any other command: print an error message and prompt for another command.

Use an integer counter for reservation ids that starts at 1. Reservation ids are not reused. Use another integer to keep track of the number of rooms reserved. Your solution will be for a boutique hotel with only 3 (very expensive) rooms. But make liberal use of #define statements so it would be trivial to adapt your solution to a larger hotel.

In: Computer Science

Assuming you have graduated and have been working for severalyears. You are planning to buy...

Assuming you have graduated and have been working for several years. You are planning to buy a double-storey link house in Bukit Mahkota built by the IOI developer which cost RM748,000 per unit for intermediate unit. You have saved some money and plan to use them as a down payment for the house that you intend to purchase. You intend to take up a loan to finance your purchase of the house for the balance of the purchase price.

  1. Calculate the amount of the down payment for the house you intend to purchase if you would like to make a 20% down payment.


  1. Calculate the amount of the loan you need to borrow from a financial institution.


  1. You intend to take up a loan for twenty years. Calculate your monthly installment if the bank charges you an interest rate of 4.5% per annum.


  1. After five years of buying the property, you decide to assess the cost of servicing the loan.


  1. In Ringgit terms, how much have you paid the lender (bank)?

  2. How much do you still owe on the property?

  3. How much interest have you paid to the lender?

  4. Fill up the following table for five years.


Month End

Beginning Principal

Annuity Payment

Interest Payment

Principal Payment

Ending Principal

1






2






:






:






60






In: Finance

"ABC Media is considering a proposal to enter a new line of business. In reviewing the...

"ABC Media is considering a proposal to enter a new line of business. In reviewing the proposal, the company’s CFO is considering the following facts: The new business will require the company to purchase additional fixed assets that will cost $2,500,000 at t=0. For tax and accounting purposes, these costs will be depreciated to 0 using straight-line depreciation. The equipment will be housed in the firm’s existing facility (built 10 years ago). The facility originally cost $5,000,000. If it is not used for the project, it can be sold now for $800,000 (after-tax value of the land). If it is used for the project, it will have no value at the end of 4 years. At the end of four years, the company will get out of the business and will sell the fixed assets for $300,000. A major factor in the decision to go ahead with the project was the results of its testing program. Two years ago, the company spent $500,000 in its test program for this project. The project will require a $400,000 increase in inventory and a $200,000 increase in accounts payable at t=0. All working capital will be recovered in the last (terminal) year of the project. The tax rate is 40%. The new business is expected to generate $10 million in sales in year 1. The operating costs, excluding depreciation, will be $4 million in year 1. Revenues and costs will increase at the inflation rate of 3% starting in year 2. The discount rate is 10%. What is the NPV of this project?"

In: Finance