Select ONE term from this set and write a historically significant identification of the term. Topic 8: The Early Republic and Market Revolution 1. Shay’s Rebellion 2. Great Compromise 3. James Madison 4. Market Revolution 5. Waltham and Lowell System
Select ONE term from this set and write a historically signi…
Select ONE term from this set and write a historically significant identification of the term. Topic 9: Competition Visions: Jefferson vs. Hamilton 1. Whiskey Rebellion 2. Bank of the United States 3. Jay’s Treaty 4. Election of 1800 5. Louisiana Purchase
Select ONE term from this set and write a historically signi…
Select ONE term from this set and write a historically significant identification of the term. Topic 10: Democracy in the Jacksonian Era 1. Missouri Compromise 2. Election of 1824 3. Nullification Crisis 4. nativism 5. War of 1812
Select ONE term from this set and write a historically signi…
Select ONE term from this set and write a historically significant identification of the term. Topic 10: Democracy in the Jacksonian Era 1. Missouri Compromise 2. Election of 1824 3. Nullification Crisis 4. nativism 5. War of 1812
You are tasked with developing a Car Rental Management Syste…
You are tasked with developing a Car Rental Management System for a small auto rental business. The system should read car inventory from a file, allow the user to rent and return cars, update records, and save all changes. This question assesses your ability to work with: 1. Car Data File – cars.txt The file cars.txt contains the car inventory. Each line has the following values, separated by commas: car model, brand, availability car model – string (e.g., Civic, Corolla, Model 3) brand – string (e.g., Honda, Toyota, Tesla) availability – either available or rented Sample cars.txt content: Civic,Honda,available Corolla,Toyota,rented Model 3,Tesla,available Mustang,Ford,available Accord,Honda,rented You may use this example or create your own cars.txt, but it must follow the same format. 2. Class Design (OOP + Inheritance) You must create the following classes: a) Class Car Attributes: model brand availability (string: “available” or “rented”) Methods: __init__ rent_car(self) – sets availability to “rented” if it is currently “available”. return_car(self) – sets availability to “available”. __str__(self) – returns a readable string like: Civic (Honda) – available b) Class ElectricCar (inherits from Car) Inherits from Car. Additional attribute, for example: battery_range (e.g., 250 miles) Overrides __str__(self) to include the extra information, e.g.: Model 3 (Tesla) – available – 250-mile range You may decide which cars are ElectricCar (for example, by model or brand). c) Class CarRentalSystem Attributes: cars – a dictionary where: keys = car model (string) values = Car or ElectricCar objects Methods (minimum): load_cars_from_file(self, filename) Reads cars.txt and fills the dictionary. save_cars_to_file(self, filename) Writes the current car data back to the file. list_cars(self) Displays all cars with brand and availability. rent_car(self, model) Rents the specified car (if it exists and is available). return_car(self, model) Returns the specified car (if it exists and is currently rented). 3. Required Functions In addition to your classes, define the following functions: def list_cars(system): Calls the appropriate method on the CarRentalSystem object to display all cars. def rent_car(system, model): Uses the CarRentalSystem to rent the car with the given model and then saves the updated data to the file. def return_car(system, model): Uses the CarRentalSystem to return the car with the given model and then saves the updated data to the file. def main(): Creates a CarRentalSystem object. Loads data from cars.txt. Repeatedly: Displays a menu of choices: List all cars Rent a car Return a car Exit Asks the user for an option and performs the corresponding action. Saves changes before exiting. 4. Exception Handling Your program must handle the following cases: Missing file (cars.txt) Use try / except FileNotFoundError. If the file does not exist: Inform the user. Allow the user to enter at least one car (model, brand, availability) manually. Store this car in the system and then create a new cars.txt file with this data. Invalid car model If the user tries to rent or return a car that does not exist in the dictionary: Print an error message such as “Car model not found.” Do not crash. 5. Program Behavior Summary When your program runs, it should: Load car data into the CarRentalSystem. Display all cars (model, brand, availability). Allow the user to: Rent a car Return a car Exit Save all changes back to cars.txt when cars are rented/returned and when the program exits. 6. Submission Instructions (Important – Read Carefully) To receive credit for this question: You must upload your .py and .txt file as a separate attachment. Copying and pasting the code directly into the text field is not acceptable. If you do not provide the .py and .txt file you will receive a score of zero for this question.
Altruistic behavior:
Altruistic behavior:
Which of the following is CORRECT based on the graph shown h…
Which of the following is CORRECT based on the graph shown here? Screenshot_2020-04-07 Microsoft Word – exam4Bbversion 2 docx – exam4Bbversion 2 pdf_22_.png
Which event best demonstrates a trophic cascade?
Which event best demonstrates a trophic cascade?
Which of the following represents supporting evidence for gl…
Which of the following represents supporting evidence for global climate change?
What is the difference between fundamental and realized ecol…
What is the difference between fundamental and realized ecological niches?