Question

In: Computer Science

There are a number of national and state parks available to tourists. Create a Park class...

There are a number of national and state parks available to tourists. Create a Park class which should have name of park, location, type of (i.e., national, state, local) facility, fee, number of employees, number of visitors recorded for the past 12 months, and annual budget data members. Write instance methods that: a) Return a string representing name of the park, the location and type of park. b) Return a string representing the name of the park, the location and facilities available c) Compute cost per visitor based on annual budget and the number of visitors during the last 12 months. d) Compute revenue from fees for the past year based on number of visitors and fee.

Solutions

Expert Solution

using System;

namespace ParkExample
{
  
   public class Park //park class
   {
   string park,location,type,facility; //required data members
   double fee;
   int noemployees,noofvisitors;
   double annualbudget;
  
  
   public Park() //default constructor
   {
       park=location=type=facility=null;
       fee=annualbudget=0;
       noemployees=noofvisitors=0;
   }
  
   public Park(string park,string location,string type,string facility, double fee,int noemployees,int noofvisitors,double annualbudget) //constructor with parameter
   {
       this.park=park; //assigning each data member
       this.location=location;
       this.type=type;
       this.facility=facility;
       this.fee=fee;
       this.noemployees=noemployees;
       this.noofvisitors=noofvisitors;
       this.annualbudget=annualbudget;
   }
  
   string getParkInfo() //get function1
   {
       return "Park name : "+park+", Location : "+location+", Type : "+type;
   }
  
   string getParkFacilities() //get function2
   {
       return "Park name : "+park+", Location : "+location+", Facilities : "+facility;
   }
  
   double getCostPerVisitor() //get cost per visitor calculated
   {
       return annualbudget/noofvisitors;
   }
  
   double getRevenue() //getting total revenue
   {
       return noofvisitors*fee;
   }
  
   public override string ToString() //overrided ToString() function from Object class
   {
   return "Park Information : \n"+getParkInfo()+"\nPark Facilities : \n"+getParkFacilities()+"\nCost per Visitor : "+getCostPerVisitor()+"\nRevenue : "+getRevenue();  
   }
}
   class MainClass
   {
       public static void Main (string[] args)
       {
           Park p=new Park("Theme park","New Delhi","Entertainment","Swings, slides",50,15,100,105674); //create park object
           Console.WriteLine(p); //printing object of park p
          
       }
   }
}

***********************************************************************************************************************************

In case of any doubt do ask in the comment section.Hope you like it


Related Solutions

Park Acreage A state executive claims that the average number of acres in western Pennsylvania state...
Park Acreage A state executive claims that the average number of acres in western Pennsylvania state parks is less than 2000 acres. A random sample of 12 parks is selected, and the number of acres is shown. 2075 2065 2174 1934 2265 1936 2277 1968 2183 2029 1976 2151 a. At = 0.01, is there enough evidence to support the claim? Use the P-value method b. Find the 99% confidence interval of the true mean.
National Park Tours Co. is a travel agency. The nine transactions recorded by National Park Tours...
National Park Tours Co. is a travel agency. The nine transactions recorded by National Park Tours during May 2019, its first month of operations, are indicated in the followingT accounts: Cash Equipment Beth Worley, Drawing (1) 32,000 (2) 2,250 (3) 23,000 (9) 3,200 (7) 12,800 (3) 4,150 (4) 3,500 (6) 9,600 (9) 3,200 Accounts Receivable Accounts Payable Fees Earned (5) 17,300 (7) 12,800 (6) 9,600 (3) 18,850 (5) 17,300 Supplies Beth Worley, Capital Operating Expenses (2) 2,250 (8) 1,300 (1)...
National Park Tours Co. is a travel agency. The nine transactions recorded by National Park Tours...
National Park Tours Co. is a travel agency. The nine transactions recorded by National Park Tours during May 2019, its first month of operations, are indicated in the following T accounts: Cash Equipment Beth Worley, Drawing (1) 75,000 (2) 900 (3) 8,000 (9) 2,500 (7) 8,150 (3) 1,600 (4) 6,280 (6) 2,700 (9) 2,500 Accounts Receivable Accounts Payable Fees Earned (5) 12,300 (7) 8,150 (6) 2,700 (3) 6,400 (5) 12,300 Supplies Beth Worley, Capital Operating Expenses (2) 900 (8) 660...
Ocean Park and Disneyland are the two theme parks in Hong Kong. They deemed to be...
Ocean Park and Disneyland are the two theme parks in Hong Kong. They deemed to be so different in their theme and attractions that they are not substitutes to one another. The two theme parks have their 1-day ticket prices revised upward in 2019 as in the following: Theme Park Ticket Was Now Ocean Park Adult (Ages 12 or above) Child              (Ages 3 – 11)                  Senior (Ages 65+)                           HK$480                           HK$240               Free of Charge                        HK$498                        HK$249...
7) In many European cities, tourists are charged one price to enter parks, exhibits, museums, etc....
7) In many European cities, tourists are charged one price to enter parks, exhibits, museums, etc. and locals are charged a lower price. Might this tie into price discrimination in some way? Write a paragraphexplaining your answer. 8) Carolina Shores rents vacation homes in NC’s Outer Banks and rents out vacation homes for homeowners. They have 2 different fees that they charge to homeowners. If the house is on a paved road in town, the commission to the homeowner is...
Case – Recreational Park Project The public has recognized the benefits of recreation and parks as...
Case – Recreational Park Project The public has recognized the benefits of recreation and parks as essential to their health and quality of life. A recent survey conducted in 2016 found that the construction of more recreational facilities was a top priority among residents in Lazarette Town (in the Caribbean). As such, the town council in Lazarette, with the help of other key stakeholders, has sourced and secured three (3) million dollars of grant funds from the Caribbean Wellness Community...
The Park Manager at Fort Fisher State Park in North Carolina believes the typical park visitor...
The Park Manager at Fort Fisher State Park in North Carolina believes the typical park visitor spends at least 90 minutes in the park during summer months. A sample of 18 visitors during the summer months of 2011 revealed the mean time in the park was 96 minutes with a standard deviation of 12 minutes. At the 0.01 significance level, is it reasonable to conclude that the mean time in the park is greater than 90 minutes? What is alpha?
Rocky Mountain National Park is a popular park for outdoor recreation activities in Colorado. According to...
Rocky Mountain National Park is a popular park for outdoor recreation activities in Colorado. According to U.S. National Park Service statistics, 46.7% of visitors to Rocky Mountain National Park in 2018 entered through the Beaver Meadows park entrance, 24.3% of visitors entered through the Fall River park entrance, 6.3% of visitors entered through the Grand Lake park entrance, and 22.7% of visitors had no recorded point of entry to the park.† Consider a random sample of 175 Rocky Mountain National...
Rocky Mountain National Park is a popular park for outdoor recreation activities in Colorado. According to...
Rocky Mountain National Park is a popular park for outdoor recreation activities in Colorado. According to U.S. National Park Service statistics, 46.7% of visitors to Rocky Mountain National Park in 2018 entered through the Beaver Meadows park entrance, 24.3% of visitors entered through the Fall River park entrance, 6.3% of visitors entered through the Grand Lake park entrance, and 22.7% of visitors had no recorded point of entry to the park.† Consider a random sample of 175 Rocky Mountain National...
R.A.T.-Create Your Own Water Park Apply your knowledge of polynomial functions to create a water park,...
R.A.T.-Create Your Own Water Park Apply your knowledge of polynomial functions to create a water park, with 6 waterslides - one for under 6 years old (highest point at least 5m above ground) two for ages 6 to 12 (highest point at least 10m above ground) three for over age 12 (highest point at least 20 m above ground) A Create a polynomial equation for each waterslide. Show all of your work. The waterslide must begin at the y axis...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT