Enter The year , With [Y] OR [N] Choice

PHOTO EMBED

Thu Sep 21 2023 07:41:34 GMT+0000 (Coordinated Universal Time)

Saved by @akaeyad

#include <iostream>

using namespace std;

int main()
{
    int year;
    char response;
    cout << "====================\n";
    cout << "== Enter the year ==\n";
    cout << "====================\n";
    cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    /*
    1982 => "My Birth Day"
    1989 => "My First Work"
    1995 => "Windows 95"
    2000 => "Windows Millennium"
    2002 => "Created My vBulletin Forum"
    Any Other Year => "No Events in This Year"
    */
    return 0;
}
content_copyCOPY