Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <windows.h>
  4. using namespace std;
  5.  
  6. const char Name_File[]="Manage assignments";
  7.  
  8. void Info(ofstream& writeFile, string&,string&,string&);
  9.  
  10.  
  11. int main()
  12. {
  13.  
  14. ofstream writeFile;
  15. x
  16. writeFile.open(Name_File);
  17.  
  18. string CourseName="";
  19.  
  20. string AssignmentName="";
  21.  
  22. string DueDate="";
  23.  
  24. bool exit_program=false;
  25.  
  26. char Operator=' ';
  27.  
  28. Menu:
  29. cout<<"----------------------------------";
  30. cout<<"\n Add New Assignment(1)"
  31. "\n\n Display All Assignments(2)"
  32. "\n\n Exit program Press(x):";
  33. cin>>Operator;
  34.  
  35. {
  36.  
  37. switch (Operator)
  38.  
  39. {
  40. case '1':
  41. Info(writeFile,CourseName,AssignmentName,DueDate);
  42.  
  43.  
  44. case 'x':
  45. cout << "\n The program has been exited";
  46. exit_program = true;
  47. break;
  48.  
  49.  
  50.  
  51. }
  52. }
  53. }
  54.  
  55. //function definition
  56. void Info(ofstream &writeFIle,string& CourseName, string& AssignmentName,string& DueDate )
  57. {
  58. ofstream writeFile;
  59.  
  60. writeFile.open(Name_File);
  61.  
  62. cout<<"\n Enter Course Name: ";
  63.  
  64. cin.get();
  65. getline(cin,CourseName);
  66.  
  67. cout<<"\n Enter Assignment Name: ";
  68. getline(cin,AssignmentName);
  69.  
  70. cout<<"\n Enter Due Date: ";
  71. getline(cin,DueDate);
  72.  
  73.  
  74.  
  75.  
  76. writeFile <<CourseName<< endl;
  77. writeFile <<AssignmentName<<endl;
  78. writeFile <<DueDate<< endl;
  79.  
  80. writeFile.close();
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement