Report any file problem from main if the array was filled


To Write a c++ program that sets up a class sailboat containing private data for a boat's manufacturer and name, length, beam (width), and draught (water depth required to float the boat) . The class has Set functions for all data as well as WriteInfo that reports all the Sailboat object data to the screen. One boat is greater than another if it is longer. If the boats are the same length , then the larger beamed boat is bigger.

Create a data file of a boat called "boat.txt" so that first line is the total number of boats in the file; the next three lines are the manufacture; followed by the name; and then the boat length, beam, and draught. For example:

3

McGregor 25

The Sparkly Lady

25 8 3.5

Victoria

WayLay

18 6 3

Hobie

Lazy Days

In main, call ReadFile, which open your data file and fill your Sailboat array with the boat data from the file. It returns a true if it found the file and read successfully, a false if it could not open the file, Report any file problem from main. If the array was filled, show the boat information in the order of the data file (unsorted).

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: Report any file problem from main if the array was filled
Reference No:- TGS01368691

Expected delivery within 24 Hours