program c++ print calender HELP

Discussion in 'C++' started by programmer c++, Jan 15, 2009.

Thread Status:
Not open for further replies.
  1. programmer c++

    programmer c++ New Member

    Joined:
    Jan 15, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hey
    this program print calender can some body HELP me to complete
    please

    the print of program i need is in the attache file




    PHP:
    /* 
     * Please fill following fields with relevant information
     * ***************************************************************************
     * Course [CS140/CS201]: 
     * Section [171-177]:
     * Student 1 id: 
     * Student 1 Name: 
     * Student 2 id: 
     * Student 2 Name: 
     * ***************************************************************************
     */
    #include <iostream>
    #include <iomanip>
    using namespace std;
    //do not modify data types and consts
    enum weekDay {SaturdaySundayMondayTuesdayWednesdayThursdayFriday};
    const 
    enum weekDay d01y01m1430  Monday;
    const 
    char *weekDayStr[] = {"Sa""Su""Mo""Tu""We""Th""Fr"};
    const 
    char *monthStr[] = {"Muharram""Safar""Rabi' Al-Awwal""Rabi' Al-Akhir""Jumada Al-Awwal""Jumada Al-Akhir""Rajab""Sha'aban""Ramadan""Shawwal""Dhu Al-Qi'da""Dhu Al-Hijjah"};
    const 
    int nDaysPerMonth1430[] = {293030292930293029302930};
    const 
    int WEEKS 5// 5 weeks a month
    const int DAYS 7;// 7 days a week
    const int MONTHS 12// 12 months a year

    // do not modify menu
    int menu() {
      
    int op;
      
    int m;
      do {
        
    1;
        
    cout <<setfill('*')<<setw(80)<<'*'<<endl;
        
    cout <<'*'<<setfill(' ')<<setw(4)<<' '<<setw(66)<<left<<"Display Year" <<right<<setw(5)<<m++<<setw(4)<<'*'<<endl;
        
    cout <<'*'<<setfill(' ')<<setw(4)<<' '<<setw(66)<<left<<"Display Month" <<right<<setw(5)<<m++<<setw(4)<<'*'<<endl;
        
    cout <<'*'<<setfill(' ')<<setw(4)<<' '<<setw(66)<<left<<"Display Week" <<right<<setw(5)<<m++<<setw(4)<<'*'<<endl;
        
    cout <<'*'<<setfill(' ')<<setw(4)<<' '<<setw(66)<<left<<"Display Day" <<right<<setw(5)<<m++<<setw(4)<<'*'<<endl;
        
    cout <<'*'<<setfill(' ')<<setw(4)<<' '<<setw(66)<<left<<"Exit" <<right<<setw(5)<<m++<<setw(4)<<'*'<<endl;
        
    cout <<setfill('*')<<setw(80)<<'*'<<endl;
        
    cout<<setfill(' ');
        
    cin >> op;
      } while (
    op || op >= m);
      return 
    op;
    }
     
    void fillDays(int days[WEEKS][DAYS][MONTHS]) { 
      
    // add code here
    }
    void displayYear(const int days[WEEKS][DAYS][MONTHS], int monthsPerRow) {
      
    // add code here
    }
    void displayMonth(int days[WEEKS][DAYS][MONTHS], int month) {
      
    // add code here
    }
    void displayWeek(int days[WEEKS][DAYS][MONTHS], int monthint week) {
      
    // add code here
    }
    void displayDay(int days[WEEKS][DAYS][MONTHS], int monthint day) {
      
    // add code here
    }
    // do not modify main
    int main() {
      
    int days[WEEKS][DAYS][MONTHS] = {{{0}}};
      
    int monthsPerRow 1;
      
    int month;
      
    int week;
      
    int day;
      
    fillDays(days);
      do {
        
    int op menu();
        switch (
    op) {
          case 
    1:
            
    cout <<"Display Year:"<<endl;
            do {
              
    cout <<"monthsPerRow (1-3) = ";
              
    cin >> monthsPerRow;
            } while (
    monthsPerRow || monthsPerRow 3);
            
    displayYear(daysmonthsPerRow);
            break;
          case 
    2:
            
    cout <<"Display Month"<<endl;
            do {
              
    cout <<"month (1-12) = ";
              
    cin >> month;
            } while (
    month || monthsPerRow 12);
            
    displayMonth(daysmonth);
            break;
          case 
    3:
            
    cout <<"Display Week:"<<endl;
            do {
              
    cout <<"month (1-12) = ";
              
    cin >> month;
            } while (
    month || month 12);
            do {
              
    cout <<"week (1-5) = ";
              
    cin >> week;
            } while (
    week || week 5);
            
    displayWeek(daysmonthweek);
            break;
          case 
    4:
            
    cout <<"Display Day:"<<endl;
            do {
              
    cout <<"month (1-12) = ";
              
    cin >> month;
            } while (
    month || month 12);
            do {
              
    cout <<"day (1-"<<nDaysPerMonth1430[month-1]<<") = ";
              
    cin >> day;
            } while (
    day || day nDaysPerMonth1430[month-1]);
            
    displayDay(daysmonthday);
            break;
          default:
            
    cout <<"Exit"<<endl;
            exit(
    0);
        }
      } while (
    1);
      return 
    0;
    }
     

    thank you
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice