Concept explainers
PLEASE TYPE ONLY****
LAST TWO DIGITS OF PANTHER ID : 64
Task:
1. Park class with the following class variables: 1) String ParkName; 2) int ParkID;
3) String ParkShape; and 4) double ParkLength. Please implement the following methods:
i) ParkNameGetter(): Return the name of the park.
ii) ParkIDGetter(): Return the ID of the park.
iii) ParkLengthGetter(): Return the length of the park.
Note that, 1) ParkLength is private while the other variables are public.
2) ParkShape only includes "Circle" and "Square".
3) Parks may have the same name, but ParkID is unique.
4) Students should create the correct constructor.
2. ParkClient class.
i) an array of Park:
- ParkArray has 5 elements;
- Set the first park in ParkArray with the following parameters: ParkName: CSC1302, ParkID: Last 2 digits of PantherID, ParkShape: "Circle", ParkLength: 5.
- Set the second park in ParkArray with the following parameters: ParkName: CSC1302,
ParkID: Last 2 digits of PantherID + 3, ParkShape: "Square", ParkLength: 6.
- Randomly Set the other three parks in ParkArray.
ii) Print out the information of the Largest Park of all parks in the ParkArray.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- Python Code please Point of Sale Write a program that will manage the point of sale in a store. Build the ItemToPurchase class with the following: Attributes item_name (string) item_price (int) item_quantity (int) Default constructor Initializes item's name = "none", item's price = 0, item's quantity = 0 Method print_item_cost() Example of print_item_cost() output:Bottled Water 10 @ $1 = $10 Extend the ItemToPurchase class to contain a new attribute. item_description (string) - Set to "none" in default constructor Implement the following method for the ItemToPurchase class. print_item_description() - Prints item_description attribute for an ItemToPurchase object. Has an ItemToPurchase parameter. Example of print_item_description() output:Bottled Water: Deer Park, 12 oz. Build the ShoppingCart class with the following data attributes and related methods. Note: Some can be method stubs (empty methods) initially, to be completed in later steps. Parameterized constructor…arrow_forwardQuestion 31 class Person: def __init__(mysillyobject, name, age): = name mysillyobject.name mysillyobject.age = age def myfunc(abc): print("Hello my age is", abc.age) p1 = Person("John", 36) p1.age = 40 p1.myfunc() O 40 Hello my age is 40 36 Hello my age is 36arrow_forwardFocus on classes, objects, methods and good programming styleYour task is to create a BankAccount class. Class name BankAccount Attributes __balance float float __pin integer integer Methods __init_()get_pin()check_pin()deposit()withdraw()get_balance() The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). The pin should be generated randomly when the account object is created. The initial balance should be 0.get_pin()should return the pin.check_pin(pin) should check the argument against the saved pin and return True if it matches, False if it does not.deposit(amount) should receive the amount as the argument, add the amount to the account and return the new balance.withraw(amount) should check if the amount can be withdrawn (not more than is in the account), If so, remove the argument amount from the account and return the new balance if the transaction was successful. Return False if it was not.get_balance()…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education