Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.13 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. #include <string>
  4. #include <ShlObj.h>
  5. #include <ctime>
  6.  
  7. #define MAX_DATE 12
  8.  
  9. using namespace std;
  10.  
  11.  
  12. int choice_2;
  13. string new_entry;
  14. string entry;
  15. string location;
  16. string folder_name;
  17.  
  18. void menu();
  19. //void create_entry();
  20. //void modify_entry();
  21. void delete_entry();
  22. void exit_program();
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. int main()
  33. {
  34.     int choice;
  35.     cout << "Welcome to the SSD Journal Application!" << endl;
  36.     do {
  37.        
  38.         menu();
  39.         cin >> choice;
  40.         cout << endl;
  41.  
  42.         if (choice == 1){
  43.        
  44.             cout << endl;
  45.         }
  46.  
  47.        
  48.  
  49.         else if (choice == 2) {
  50.             //modify_entry;
  51.  
  52.            
  53.         }
  54.        
  55.         else if (choice == 3) {
  56.             delete_entry();
  57.             cout << endl;
  58.         }
  59.  
  60.        
  61.         else if (choice == 4) {
  62.        
  63.        
  64.        
  65.         }
  66.  
  67.        
  68.         else if (choice == 5) {
  69.             exit_program();
  70.         }
  71.        
  72.         else {
  73.             cout << "You have entered an invalid option. Please pick an option from the following commands:" << endl;
  74.         }
  75.  
  76.     } while (choice != 5);
  77.    
  78.    
  79.    
  80. }
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. void menu()
  88. {
  89.     cout << "What would you like to do? Here are your following options:" << endl;
  90.     cout << "1. Create new entry" << endl;
  91.     cout << "2. Modify existing entry" << endl;
  92.     cout << "3. Delete entry" << endl;
  93.     cout << "4. List past 10 entries" << endl;
  94.     cout << "5. Exit program" << endl;
  95.     cout << "What would you like to do?" << endl;
  96.     }
  97.  
  98.  
  99. void create_entry() {
  100.     string file_name;
  101.     cout << "You have chosen to create a new entry." << endl;
  102.     Sleep(1000);
  103.     cout << "What do you want your entry to be named?" << endl;
  104.     cin >> file_name;
  105.     file_name += ".txt";
  106.     ofstream outputfile(file_name);
  107.    
  108.  
  109. }
  110.  
  111. //void modify_entry() {
  112. //  cout << "You have chosen to modify an entry."
  113.  
  114. //}
  115.  
  116.  
  117. void delete_entry(){
  118.  
  119.     cout << "You have chosen to delete an entry." << endl;
  120.     cout << "In a moment, an Explorer window will open. From there, you can proceed to delete the entry that you want to delete." << endl;
  121.     Sleep(4000);
  122.     ShellExecute(NULL, "explore", "C:\\Journal", NULL, NULL, NULL);
  123. }
  124.  
  125.  
  126. void exit_program()
  127. {
  128.     cout << "Thank you for using the SSD Journal Application." << endl;
  129.     cout << "Please press any key to exit. Goodbye." << endl;
  130.     system("pause");
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement