ok im kinda stuck in this homework, i dont know where to go next, please help me i need this done soon!

heres the problem

Your swim school has two swimming instructors, Jeff and Anna. Their
current schedules are shown below. An "X" denotes a one-hour time slot
that is occupied with a lesson

Jeff.......Monday.....Tuesday ....Wednesday.....Thursday

11-12.......X.................. X

12-1 ............... ......... X...............X ...................X

1-2 ...........................X............…

2-3 ...........X...............X............…

Anna.......Monday.....Tuesday ....Wednesday.....Thursday

11-12.........X................ X .................................X

12-1 ............... ......... .X....................................X

1-2 ...........X...............X............…

2-3 ...........X.......... ............. ..............X ........ ...X

Write a program with array(s) capable of storing the schedules. Create
a main menu that allows the user to mark a time slot as busy or free
for either instructor. Also, add an option to ouput the schedules to
the screen. Next, add an option to output all time slots available for
invidual lessons (slots when at least one instructor is free). Finally,
add an option to output all time slots available for group lessons
(when both instructors are free).

What I need


* as indicated in the
problem description: 2 two-dimensional
arrays, one for Jeff’s schedule, and one for Anna’s

* a main menu that provides
options to the user

* a function that prints the
schedule

* a function that prompts
the user to select an instructor, day, and slot

* a function that prompts
the user, then schedules or frees one of the instructor's slots. This function calls the second function
described above.


and heres what i have so far

#include<iostream>

#include<iomanip>

using namespace std;
void Print2DArray(char [][4]);
void jeffs (char [][4]);
void annas (char [][4]);
int D;


int main()

{

 char jarray [4][4];

 char aarray [4][4];

 char ins;

     cout << "Who would you like to schedule with? Enter j for Jeff, Enter a for Anna\n";

     cin >> ins;

        



    if ((ins == 'a') || (ins == 'A'))

        {

                jeffs (aarray);

        }
 else if ((ins == 'j') || (ins == 'J'))

     {

                jeffs (jarray);

     }

        

        

        else 

        {

                cout << "Invalid submission, please select a for anna, and j for jeff.\n";

        }

        

}




void annas (char a1 [][4])

{

        char date;

        int time
			;


        cout <<  "Please enter the first letter of the day you would like to schedule, the days available are  \n"
			"M for Monday, T for Tuesday, W for Wednesday, and R for Thursday.\n" ;

        cin >> date;

        

        cout << "Please enter a time, the times available are  11, 12, 1, or 2.\n"; 

        cin >> time;

        

                switch (date)

                {

                case 'M':

                case 'm':

									if (time == 11)

                                {

									 a1 [0][0] = 'D';

                                }

                                           

									  else if (time == 12)

                                {

									  a1 [1][0] = 'D';
	
                                }

                                           

									  else if (time == 1)
		
                                {

										a1 [2][0] = 'D';

                                }

                                           

                                else if (time == 2)

                                {

                                a1 [3][0] = 'D';

                                }

                                

                                else

                                {

                                cout << "You've entered an invalid time.\n";

                                return;

                                }

                                break;

                                           

                case 'T':

                case 't':

                        if (time == 11)

                        {

                        a1 [0][1] = 'D';

                        }

                                           

                        else if (time == 12)

                        {

                        a1 [1][1] = 'D';

                        }

                                           

                        else if (time == 1)

                        {

                        a1 [2][0] = 'D';

                        }

                                   

                        else if (time == 2)

                        {

                        a1 [3][1] = 'D';

                        }

                                   

                        else

                        {

                        cout << "You've entered an invalid time.\n";

                        return;

                        }

                        break;

                                   

                case 'W':

                case 'w':

                        if (time == 11)

                        {

                        a1 [0][2] = 'D';

                        }

                                                          

                        else if (time == 12)

                        {

                        a1 [1][2] = 'D';

                        }

                                   

                        else if (time == 1)

                        {

                        a1 [2][2] = 'D';

                        }

                        

                        else if (time == 2)

                        {

                        a1 [3][2] = 'D';

                        }

                        

                        else

                        {

                        cout << "You've entered an invalid time.\n";

                        return;

                        }

                        break;

                                   

        case 'R':

        case 'r':

                if (time == 11)

                {

                a1 [0][3] = 'D';

                }

                                                          

                else if (time == 12)

                {

                a1 [1][3] = 'D';

                }

                                   

                else if (time == 1)

                {

                a1 [2][3] = 'D';

                }

                                

                else if (time == 2)

                {

                a1 [3][3] = 'D';

                }

                                                          

                else

                {

                cout << "You've entered an invalid time.\n";

                return;

                }

                break;

                                                          

                defaut:

                cout<< "Please try again, the times available are\n" 
					"M for Monday, T for Tuesday, W for Wednesday, and R for Thursday.\n";

                return;

                }

        }



                                                          
void jeffs (char a1 [][4])

{

      char date;

      int time;

      cout << "Please enter the first letter of the day you would like to schedule. The days available are,\n" 
	  " M for Monday, T for Tuesday, W for Wednesday, and R for Thursday.\n" ;


      cin >> date;

        

      cout << "Please enter the time you would like to schedule , the times available are\n"
		  "11, 12, 1, or 2.\n"; 

      cin >> time;

        
      switch (date)

        {
            case 'M':

            case 'm':

                if (time == 11)

                   {

                     a1 [0][0] = 'D';

                   }

                        

                        else if (time == 12)

                        {

                                a1 [1][0] = 'D';

                        }

                        

                        else if (time == 1)

                        {

                                a1 [2][0] = 'D';

                        }

                        

                        else if (time == 2)

                        {

                                a1 [3][0] = 'D';

                        }

                        

                        else

                        {

                                cout << "You entered an invalid time.\n";

                                return;

                        }

                        break;

                        

                case 'T':

                case 't':

                        if (time == 11)

                        {

                                a1 [0][1] = 'D';

                                

                        }

                        

                        else if (time == 12)

                        {

                                a1 [1][1] = 'D';

                        }

                        

                        else if (time == 1)

                        {

                                a1 [2][0] = 'D';

                        }

                                           

                        else if (time == 2)

                        {

                                a1 [3][1] = 'D';

                        }

                        

                        else

                        {

                                cout << "You've entered an invalid time.\n";

                                return;

                        }

                        break;

                        

                        case 'W':

                        case 'w':

                                if (time == 11)

                                {

                                a1 [0][2] = 'D';

                                }

                        

                                else if (time == 12)

                                {

                                a1 [1][2] = 'D';

                                }

                        

                                else if (time == 1)

                                {

                                a1 [2][2] = 'D';

                                }

                                           

                                else if (time == 2)

                                {

                                a1 [3][2] = 'D';

                                }

                        

                                else

                                {

                                cout << "You've entered an invalid time.\n";

                                return;

                                }

                                break;

                        

                        case 'R':

                        case 'r':

                                if (time == 11)

                                        {

                                        a1 [0][3] = 'D';

                                        }

                        

                                        else if (time == 12)

                                        {

                                        a1 [1][3] = 'D';

                                        }

                        

                                        else if (time == 1)

                                        {

                                        a1 [2][3] = 'D';

                                        }

                                           

                                        else if (time == 2)

                                        {

                                        a1 [3][3] = 'D';

                                        }

                        

                                        else

                                        {

                                        cout << "You've entered an invalid time.\n";

                                        return;

                                        }

                                        break;

                                           

                                        defaut:

                                        cout<< "Please try again,  M for Monday, T for Tuesday, W for Wednesday, and R for Thursday.";

                                        return;

                                        }

        }




void Print2DArray(char arr1[][4])
{
int i = 0, j;
while (i < 3)
{
j = 0;
while (j < 3)
{
cout<<setw(5)<<arr1[i][j];
j++;
}
cout<<endl;
i++;
return ;
}
}

You're my only hope!

Recommended Answers

All 2 Replies

First, reformat the code to take out all the unnecessary blank lines.
Second, ask a specific question explaining specifically the first thing you need help with
Third, point out where in the code you attempted to solve the problem and what happened

Do you and "omgaga" go to the same school?

Same thing was posted some days back as well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.