I have no idea what else to do with this assignment. I am required to write a program that does this.
1. Create 2 text files on your drive F:\Lincoln.txt and F:\Kennedy.txt. (I did)
2. The program calls a funcation named: getChoices()
-The function displays two choices (A and B) and then prompts the user to enter a choice
- After the user's choice has been entered, the function displays two more choices (C and D) and then prompts the user to another choice
The function is void-returning, but the two choices are assigned variables declared in main()
3. The program should read oneo f the two files depending on the user's choice(A or B)
4. The program should then either write the speech to another file, or to the screen, depending on the user's choice C or D
5. Include a while loop that allos the user to run the program again.
If the program runs again, make sure to close all files before re-entering
if the program runs again, the screen clears
This is all I got
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include<iostream>
#include<fstream>
#include<iomanip>
char getChoice();
int main()
{
char choice
char getChoice
return 0;
}
char getChoice();
{
char choice;
cout << "Which speech do you want to read? ";
cout << "A. Read the file containing a speech by Lincoln.";
cout << "B. Read the file containing a speech by Kennedy. ";
cin >> choice;
if (toupper(choice == 'A');
{
if (inFile.eof())
break;
inFile.get(character);
outFile << character;
|