Please rewrite the code given below and written in C, in Python.   #include #include int main(int argc, char *argv[]) { int chart[10][5]; int employeeArray[6]; int employee, employee1, employee2; int sec,i; srand(time(NULL)); do{ select=monu(); switch(selection) { case 0: printf("Program Terminated"); break; case 1: fill(table, employeeArray); print chart(schedule); break; case 2: printf("\nEnter Employees to Replace:"); scanf("%d%d",&work1,&work2); change(schedule,employee1,worker2); break; case 3: printf("\nAre you to be asked for Weekly Work Details?"); scanf("%d",&working); dayMonthSummer(schedule,employee); break; default: printf("\n Incorrect entry \a\n"); } }while(choice!=0); return 0; } int monu() { int select; printf("\n_____MONU_____ \n"); printf("0- Close Program\n"); printf("1- Print Weekly Schedule \n"); printf("2- Swap Employees\n"); printf("3- Get Employee Weekly Work Details\n"); printf("___________\n"); printf("Your choice: "); scanf("%d",&select); return choice; } void fill(int array[][5],int array2[]) { int i; int n; for(i=1;i<6;i++) { array2[i]=10; } printf("\n"); int value;//generated EmployeeCode for(n=0;n<10;n++){ for(i=0;i<5;++i) { value=rand() 5% + 1; if(employeeControl(array2,value)==-1){ I--; continue; } else array[n][i]=value; } } } int runningControl(int generatedValue[],int value) { if(generatedValue[value]!=0) { generatedValue[value]--; return 1; } else return -1; } int print chart(int array[][5]) { printf("\t Monday Tuesday Wednesday Thursday Friday\n"); int n, i; for(n=0;n<10;n++){ printf("%d. Range:\t",n+1); for(i=0;i<5;++i) { printf("%d\t",array[n][i]); } printf("\n"); } }   void replace(int array[][5],int c1,int c2) { int n,i; int array2[10][5]={0}; for(n=0;n<10;n++){ for(i=0;i<5;++i) { if(array[n][i]==c2) array2[n][i]=c2; } } for(n=0;n<10;n++){//Overwrite in the Array 10 points for(i=0;i<5;++i) { if(array[n][i]==c1) { array[n][i]=c2; } } } for(n=0;n<10;n++){//Finally, the backup is transferred to the main table 15 points for(i=0;i<5;++i) { if(array[n][i]-array2[n][i]==0) { array[n][i]=c1; } } } printf("Operation Done\n"); printtable(array); } void gunMonth(int array[][5],int c) { int n,m; for(n=0;n<10;n++) for(m=0;m<5;m++) if(array[n][m]==c) { printf("%d. Range\t",n+1); gunCall(m); printf("\n"); } }   void dayCall(int n) { switch(n) { case 0: printf("Monday"); break; case 1: printf("Tuesday"); break; case 2: printf("Wednesday"); break; case 3: printf("Thursday"); break; case 4: printf("Friday"); break; } }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please rewrite the code given below and written in C, in Python.

 

#include <stdio.h>
#include <stdlib.h>


int main(int argc, char *argv[]) {
int chart[10][5];
int employeeArray[6];
int employee, employee1, employee2;
int sec,i;
srand(time(NULL));
do{
select=monu();
switch(selection)
{
case 0:
printf("Program Terminated");
break;
case 1:
fill(table, employeeArray);
print chart(schedule);
break;
case 2:
printf("\nEnter Employees to Replace:");
scanf("%d%d",&work1,&work2);
change(schedule,employee1,worker2);
break;
case 3:
printf("\nAre you to be asked for Weekly Work Details?");
scanf("%d",&working);
dayMonthSummer(schedule,employee);
break;
default:
printf("\n Incorrect entry \a\n");
}

}while(choice!=0);
return 0;
}
int monu()
{
int select;
printf("\n_____MONU_____ \n");
printf("0- Close Program\n");
printf("1- Print Weekly Schedule \n");
printf("2- Swap Employees\n");
printf("3- Get Employee Weekly Work Details\n");
printf("___________\n");
printf("Your choice: ");
scanf("%d",&select);
return choice;
}


void fill(int array[][5],int array2[])

{

int i;
int n;
for(i=1;i<6;i++)
{
array2[i]=10;

}
printf("\n");
int value;//generated EmployeeCode

for(n=0;n<10;n++){

for(i=0;i<5;++i)
{

value=rand() 5% + 1;


if(employeeControl(array2,value)==-1){
I--;
continue;
}
else
array[n][i]=value;

}

}

}

int runningControl(int generatedValue[],int value)
{
if(generatedValue[value]!=0)
{
generatedValue[value]--;
return 1;
}

else
return -1;
}
int print chart(int array[][5])
{
printf("\t Monday Tuesday Wednesday Thursday Friday\n");
int n, i;
for(n=0;n<10;n++){
printf("%d. Range:\t",n+1);
for(i=0;i<5;++i)
{
printf("%d\t",array[n][i]);
}
printf("\n");
}
}

 

void replace(int array[][5],int c1,int c2)
{
int n,i;
int array2[10][5]={0};
for(n=0;n<10;n++){

for(i=0;i<5;++i)
{
if(array[n][i]==c2)
array2[n][i]=c2;
}
}


for(n=0;n<10;n++){//Overwrite in the Array 10 points

for(i=0;i<5;++i)
{
if(array[n][i]==c1)
{

array[n][i]=c2;
}
}
}

for(n=0;n<10;n++){//Finally, the backup is transferred to the main table 15 points

for(i=0;i<5;++i)
{
if(array[n][i]-array2[n][i]==0)
{
array[n][i]=c1;
}
}
}
printf("Operation Done\n");
printtable(array);

}

void gunMonth(int array[][5],int c)
{
int n,m;
for(n=0;n<10;n++)
for(m=0;m<5;m++)
if(array[n][m]==c)
{
printf("%d. Range\t",n+1);
gunCall(m);
printf("\n");
}
}

 

void dayCall(int n)
{
switch(n)
{
case 0:
printf("Monday");
break;
case 1:
printf("Tuesday");
break;
case 2:
printf("Wednesday");
break;
case 3:
printf("Thursday");
break;
case 4:
printf("Friday");
break;

}
}

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY