Question
Write a class def for a class called 'flight'. It should have 5 properties and 2 methods. Instantiate two instances of the flight and call
- Write a class def for a class called 'flight'. It should have 5 properties and 2 methods. Instantiate two instances of the flight and call both methods. The constructor should take flightNumber as an arg.
- Methods: setDeparture(), setArrival()
- Properties: arrivalTime, departureTime, origin, destination, flightNumber
- Write a class def for a class called 'journal'. It should have 4 properties and 4 methods. Two of the methods should take at least one argument.
- Instantiate the class and call two methods.
- Methods: addText, addDate, addUsername, getText
- Properties: text, date, username, mood
3. Write a class def for a class called 'graph'. It should take a name as a constructor arg and have 2 methods: addY() which takes a list of 10 ints as arguments. A 2nd method show() should return an ascii graph of the data as a string like:
4. Create a class def for a class called 'weatherReport'. The constructor should take a city and state as arguments. The class should have 3 methods to set the temp, wind (speed and direction) and conditions. Condition should be one of the following: clear, partly cloudy, overcast, rain, snow. The class should have a method called getWarnings. The method should return a list of warnings based on the conditions. Here are the warnings:
- wind > 40mph = High wind warning
- temp > 95 = High heat warning
- temp
- temp 45 and condition snow = blizzard warning
Please use programming language python
000000 000000 0000 00 00 ooooooooooooo000000000000000000000000000000000 0000 00000000000000000000000000000000000000 0000000000000000000000000000000000 000000000000 00000000000000000000 000000000000 000000 00000000 00 000000000000 00000000 000000000000 00 00 000000000000 0000000000 00 0000 0000 00 oo oo 00 00 0000000000 0000000000 0000000000 00 000000 00 00 0000 00 00 00Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started