Question: Question: Requirements: You must create a record ( using Ruby classes ) for a flight. A flight has the following attributes: an id ( integer

Question: Requirements: You must create a record (using Ruby classes) for a flight. A flight has the following attributes: an id (integer), a flight number (string) an origin airport (string) and a destination airport (string). Write a function called read_flight() that reads from the terminal values for each of the fields in a Plane record and returns the completed
Requirements:
You must create a record (using Ruby classes) for a flight. A flight has the following attributes: an id (integer), a flight number (string) an origin airport (string) and a destination airport (string).
Write a function called read_flight() that reads from the terminal values for each of the fields in a Plane record and returns the completed record.
Write a procedure called print_flight(flight) that takes a flight record and writes each of the fields to the terminal with a description for the field as well as the field value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!