
I need a step by step explanation on how to create this project.
Project: Flight Time
Problem Description:
Design two classes: Flight and Itinerary. The Flight class stores the information about a flight with the following members:
- A data field named flightNo of the String type with getter function.
- A data field named departureTime of the GregorianCalendar type with getter and setter functions.
- A data field named arrivalTime of the GregorianCalendar type with getter and setter functions.
- A constructor that creates a Flight with the specified number, departureTime, and arrivalTime.
- A function named getFlightTime() that returns the flight time in minutes.
The Itinerary class stores the information about the itinerary with the following members:
- A data field named flights of the List<Flight> type. The list contains the flights for the itinerary in increasing order of departureTime.
- A constructor that creates an Itinerary with the specified fights.
- A function named getTotalTime() that returns the total travel time in minutes from the departure time and the first flight to the arrival time of the last flight in the itinerary.
Implement these two classes and use the following
int main()
{
flights.push_back(Flight("US230",
Time(2014, 4, 5, 5, 5, 0),
Time(2014, 4, 5, 6, 15, 0)));
flights.push_back(Flight("US235",
Time(2014, 4, 5, 6, 55, 0),
Time(2014, 4, 5, 7, 45, 0)));
flights.push_back(Flight("US237",
Time(2014, 4, 5, 9, 35, 0),
Time(2014, 4, 5, 12, 55, 0)));
Itinerary itinerary(flights);
cout << itinerary.getTotalTravelTime() << endl;
cout << itinerary.getTotalFlightTime() << endl;
return 0;
}
Analysis:
(Describe the problem, including input and output in your own words.)
Design:
(Describe the major steps for solving the problem.)
Coding: Using Visual Studio, create the following program. Include the following in the .cpp file:
- Using comments at the top of the file, your first and last name, date, and purpose of the program
- Meaningful comments to explain the code throughout the program.
- Place your initials in front of all variable names (ex. BWflightNo)
- Place your initials in front of all function names (ex. BWgetTotalTraveltime())
- Submit the FirstNameLastNameAnagrams.cpp (BridgetWillisFlightTimes.cpp) file to the drop box
Testing: (Describe how you test this program)
Submit the following items:
- Submit the Word file
- Submit the .cpp file

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 6 images

- B. Pet Class Using Python Program, Write a class named Pet, which should have the following data attributes: • _ _name (for the name of a pet) •__animal_type (for the type of animal that a pet is. Example values are 'Dog', 'Cat', and `Bird')' __age (for the pet's age) init The Pet class should have an method that creates these attributes. It should also have the following methods: set_name() This method assigns a value to the __name field. set_animal_type() This method assigns a value to the __animal_type field. • set_age() This method assigns a value to the • get_name() This method returns the value of the get_animal_type() This method returns the value of the __animal_type field. • get_age() This method returns the value of the _age field. Once you have written the class, write a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored as the object's attributes. Use the object's accessor methods…arrow_forwardclass Widget: """A class representing a simple Widget === Instance Attributes (the attributes of this class and their types) === name: the name of this Widget (str) cost: the cost of this Widget (int); cost >= 0 === Sample Usage (to help you understand how this class would be used) === >>> my_widget = Widget('Puzzle', 15) >>> my_widget.name 'Puzzle' >>> my_widget.cost 15 >>> my_widget.is_cheap() False >>> your_widget = Widget("Rubik's Cube", 6) >>> your_widget.name "Rubik's Cube" >>> your_widget.cost 6 >>> your_widget.is_cheap() True """ # Add your methods here if __name__ == '__main__': import doctest # Uncomment the line below if you prefer to test your examples with doctest # doctest.testmod()arrow_forwardExercise 1-Account class • Design a class named Account that contains : • A private int data field named id for the account • A private double data field named balance for the account • A privet Date data field named dateCreated that stores the date when the account was created • A no-arg constructor that creates a default account • A constructor that creates an account with the specified id and initial balance • The getters (i.e., accessors) and setters (i.e., mutators) methods for id and balance • The getter method for dateCreated • A method named withdraw that withdraws a specified amount from the account • A method named deposit that deposits a specified amount to the accountarrow_forward
- functions return the value of a data member. A. Accessor OB. Member C. Mutator OD. Utilityarrow_forwardCar Class Project The car classwill havethe following attributes: •year: an integer that holds the car's model year •model: a string that holds the make of the car •make: a string that holds the model of the car •speed: an integer that holds the car's current speed Your class should contain thefollowing: A docstring that briefly describes the class and lists the attributes. The docstring will serve as the documentation for your class. •A constructor (__init__ method) that takes the car's year model and make as optional arguments. The constructor will set the value of the speed attribute to 0.•An __str__ method that returns the car's year model and makein a string. •To test your class, create acar object and use the print function to verify that the constructor and __str__ methodsare working correctly. •An accessor method which returns the value stored in the speed instance variable. Call this method getSpeed(). •A modifier method called accelerate() which adds 5 to the speed variable…arrow_forwardDouble Bubble For this exercise you need to create a Bubble class and construct two instances of the Bubble object. You will then take the two Bubble objects and combine them to create a new, larger combined Bubble object. This will be done using functions that take in these Bubble objects as parameters. The Bubble class contains one data member, radius_, and the corresponding accessor and mutator methods for radius_, GetRadius and SetRadius. Create a member function called CalculateVolume that computes for the volume of a bubble (sphere). Use the value 3.1415 for PI. Your main function has some skeleton code that asks the user for the radius of two bubbles. You will use this to create the two Bubble objects. You will create a CombineBubbles function that receives two references (two Bubble objects) and returns a Bubble object. Combining bubbles simply means creating a new Bubble object whose radius is the sum of the two Bubble objects' radii. Take note that the CombineBubbles function…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





