Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <windows.h>
- using namespace std;
- const char Name_File[]="Manage assignments";
- void Info(ofstream& writeFile, string&,string&,string&);
- int main()
- {
- ofstream writeFile;
- x
- writeFile.open(Name_File);
- string CourseName="";
- string AssignmentName="";
- string DueDate="";
- bool exit_program=false;
- char Operator=' ';
- Menu:
- cout<<"----------------------------------";
- cout<<"\n Add New Assignment(1)"
- "\n\n Display All Assignments(2)"
- "\n\n Exit program Press(x):";
- cin>>Operator;
- {
- switch (Operator)
- {
- case '1':
- Info(writeFile,CourseName,AssignmentName,DueDate);
- case 'x':
- cout << "\n The program has been exited";
- exit_program = true;
- break;
- }
- }
- }
- //function definition
- void Info(ofstream &writeFIle,string& CourseName, string& AssignmentName,string& DueDate )
- {
- ofstream writeFile;
- writeFile.open(Name_File);
- cout<<"\n Enter Course Name: ";
- cin.get();
- getline(cin,CourseName);
- cout<<"\n Enter Assignment Name: ";
- getline(cin,AssignmentName);
- cout<<"\n Enter Due Date: ";
- getline(cin,DueDate);
- writeFile <<CourseName<< endl;
- writeFile <<AssignmentName<<endl;
- writeFile <<DueDate<< endl;
- writeFile.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement