Introduction to C++ (part 2)
- Due Sep 23, 2019 by 10pm
- Points 0
- Submitting a file upload
Creating C++ programs
Write a complete C++ program that will meet the following specifications
Airline reservations
For this problem, you are to read in a file name. The file contents will start with a number, which indicates the number of seats in the airplane. For the remaining number of lines in the file, each line will consist of a number (representing a seat location) and a passenger name. After all the lines have been read, print out an ordered list (by seat location) of the passengers in each seat. If a seat has not been assigned a passenger, display the text
UNUSED
instead of the passenger name.
Example Input File
10 3 John Doe 7 Jane Doe 1 Mr. President
Example Output
Mr. President UNUSED John Doe UNUSED UNUSED UNUSED Jane Doe UNUSED UNUSED UNUSED
Histogram
For this problem, you are to read in a file name. The file contents are not specified. You are to read the entire contents and display a count of each unique character in the file. The final counts should be sorted by the ASCII value of the characters.
Example Input File
This is a test. This is another test. Big line here to see if you can read in anything that you see.
Example Output
The letter was in the file 19 times The letter . was in the file 3 times The letter B was in the file 1 times The letter T was in the file 2 times The letter a was in the file 6 times The letter c was in the file 1 times The letter d was in the file 1 times The letter e was in the file 11 times The letter f was in the file 1 times The letter g was in the file 2 times The letter h was in the file 6 times The letter i was in the file 9 times The letter l was in the file 1 times The letter n was in the file 6 times The letter o was in the file 4 times The letter r was in the file 3 times The letter s was in the file 8 times The letter t was in the file 9 times The letter u was in the file 2 times The letter y was in the file 3 times