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...
The following information is available for Park Valley Spa for July Year 1: BANK STATEMENT STATE...
The following information is available for Park Valley Spa for July Year 1: BANK STATEMENT STATE BANK BOLTA VISTA, NV 10001 Park Valley Spa 10 Main Street Bolta Vista, NV 10001 Account number 12-4567 July 31, Year 1 Beginning balance 6/30/Year 1 $ 9,770 Total deposits and other credits 29,805 Total checks and other debits 22,513 Ending balance 7/31/Year 1 17,062 Checks and Debits Deposits and Credits Check No. Amount Date Amount 2350 $ 3,768 July 1 $ 1,104 2351...
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...
create a public class and a main class to deletebyStudentID number with get ID and getStudentByName...
create a public class and a main class to deletebyStudentID number with get ID and getStudentByName in public class. when the user is prompted to search for the student and delete them by their. ID has seven digits and 6 students each. Ex. Delete student by their ID         Enter students name and their ID         Vanessa,         1111-111         Vanessa is now deleted
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?
Question 1 - Create a class named Student that has fields for an ID number, number...
Question 1 - Create a class named Student that has fields for an ID number, number of credit hours earned, and number of points earned. (For example, many schools compute grade point averages based on a scale of 4, so a three-credit-hour class in which a student earns an A is worth 12 points.) Include methods to assign values to all fields. A Student also has a field for grade point average. Include a method to compute the grade point...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT