Order Now!

Att: Customer

Labels

Total Pageviews

Tuesday 12 April 2016

C++ assignmnet

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).


No comments:

Post a Comment