Advertisement
Guest User

Fixup 3

a guest
Jan 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.54 KB | None | 0 0
  1. //The username and the pass for the admin are admin 12321
  2. #include <stdio.h>
  3. void payment(int SInfo[100][6])
  4. {
  5. int serialnum;
  6. printf("\nPlease enter the student's serial number:\n");
  7. scanf("%d", &serialnum);
  8. printf("\nThis student paid %d of his fees.\n", SInfo[serialnum][5]);
  9. }
  10. void add(int SInfo[100][6], int TInfo[100][7], int CInfo[3][3], int TAssessment[100][6], int SAssessment[100][8], char TNotes[256][256], char SNotes[256][256])
  11. {
  12. int choice; int counter = 0; char addagain = 'a'; char redo = 'a'; char othernotes = 'a';
  13. do
  14. {
  15. printf("\nWhat would you like to add?\n1- A student and his/her information.\n2- A teacher and his/her information.\n3- A class' information.\n4- A teacher's assessment.\n5- A student's assessment.\n");
  16. scanf("%d", &choice);
  17. switch (choice)
  18. {
  19. case 1:
  20. {
  21. while(1)
  22. {
  23. printf("\nPlease enter the student's ID:\n"); //could be name later if I felt like it
  24. scanf("%d", &SInfo[counter][0]);
  25. printf("\nPlease enter the student's age:\n");
  26. scanf("%d", &SInfo[counter][1]);
  27. printf("\nPlease enter the student's gender: (1 for Male/ 0 for Female)\n");
  28. scanf("%d", &SInfo[counter][2]);
  29. printf("\nPlease enter the student's address:\n"); //it's gonna be a string later on just adding headlines
  30. scanf("%d", &SInfo[counter][3]);
  31. printf("\nPlease enter the student's telephone number:\n");
  32. scanf("%d", &SInfo[counter][4]);
  33. printf("please enter this student's fees' payment:\n");
  34. scanf("%d", &SInfo[counter][5]);
  35. printf("\n\nWould you like to add another student's information? (Y/N)\n");
  36. scanf("\n%c", &addagain);
  37. if(addagain == 'Y' || addagain == 'y')
  38. {
  39. counter++;
  40. continue;
  41. }
  42. else if(addagain == 'N' || addagain == 'n')
  43. {
  44. if(counter >= 10)
  45. {
  46. counter = 0;
  47. break;
  48. }
  49. else
  50. {
  51. printf("\nInsufficient number of students were added, please add more.\n");
  52. continue;
  53. }
  54. }
  55. }
  56. break;
  57. }
  58. case 2:
  59. {
  60. counter = 0;
  61. while(1)
  62. {
  63. printf("\nPlease enter the teacher's ID:\n"); //could be name later if I felt like it
  64. scanf("%d", &TInfo[counter][0]);
  65. printf("\nPlease enter the teacher's age:\n");
  66. scanf("%d", &TInfo[counter][1]);
  67. printf("\nPlease enter the teacher's gender: (1 for Male/ 0 for Female)\n");
  68. scanf("%d", &TInfo[counter][2]);
  69. printf("\nPlease enter the teacher's Educational Level:\n"); //it's gonna be a string later on just adding headlines
  70. scanf("%d", &TInfo[counter][3]);
  71. printf("\nPlease enter the teacher's telephone number:\n");
  72. scanf("%d", &TInfo[counter][4]);
  73. printf("\nPlease enter the teacher's Specialist address:\n");
  74. scanf("%d", &TInfo[counter][5]);
  75. printf("\nPlease enter the teacher's university:\n"); //it's gonna be a string
  76. scanf("%d", &TInfo[counter][6]);
  77. printf("\n\nWould you like to add another teacher's information? (Y/N)\n");
  78. scanf("\n%c", &addagain);
  79. if(addagain == 'Y' || addagain == 'y')
  80. {
  81. counter++;
  82. continue;
  83. }
  84. else if(addagain == 'N' || addagain == 'n')
  85. break;
  86. }
  87. break;
  88. }
  89. case 3:
  90. {
  91. for(int i = 0; i < 3; i++)
  92. {
  93. printf("\nPlease enter KG%d's teacher's ID:\n",i+1); //might make it a string
  94. scanf("%d", &CInfo[i][0]);
  95. printf("\nPlease enter KG%d's location:\n", i+1);
  96. scanf("%d", &CInfo[i][1]);
  97. printf("\nPlease enter KG%d's number of students:\n", i+1);
  98. scanf("%d", &CInfo[i][2]);
  99. }
  100. break;
  101. }
  102. case 4:
  103. {
  104. counter = 0;
  105. while(1)
  106. {
  107. printf("\nPlease enter the teacher's ID that you want to add the assessment for:\n"); //could be name later if I felt like it
  108. scanf("%d", &TAssessment[counter][0]);
  109. printf("\nPlease rate his/her teaching skills: ( ? / 10 )\n");
  110. scanf("%d", &TAssessment[counter][1]);
  111. printf("\nPlease rate his/her preparation for class: ( ? / 10 )\n");
  112. scanf("%d", &TAssessment[counter][2]);
  113. printf("\nPlease rate his/her interaction with students: ( ? / 10 )\n");
  114. scanf("%d", &TAssessment[counter][3]);
  115. printf("\nPlease rate his/her use of technology in teaching: ( ? / 10 )\n");
  116. scanf("%d", &TAssessment[counter][4]);
  117. printf("\nPlease rate his/her attendance: ( ? / 10 )\n");
  118. scanf("%d", &TAssessment[counter][5]);
  119. printf("\nOther Notes?: (Y/N)\n");
  120. scanf("\n%c", &othernotes);
  121. if(othernotes == 'Y' || othernotes == 'y')
  122. {
  123. printf("\nPlease enter your notes with each word separated with an underscore");
  124. scanf("%s", TNotes[counter]); // Not sure how this works I'll leave it to you saif
  125. }
  126. else
  127. {
  128. printf("\n\nWould you like to add another assessment for a teacher? (Y/N)\n");
  129. scanf("\n%c", &addagain);
  130. if(addagain == 'Y' || addagain == 'y')
  131. {
  132. counter++;
  133. continue;
  134. }
  135. else if(addagain == 'N' || addagain == 'n')
  136. break;
  137. }
  138. }
  139. break;
  140. }
  141. case 5:
  142. {
  143. counter = 0;
  144. while(1)
  145. {
  146. printf("\nPlease enter the student's ID that you want to add the assessment for:\n"); //could be name later if I felt like it
  147. scanf("%d", &SAssessment[counter][0]);
  148. printf("\nPlease rate his/her attendance: ( ? / 10 )\n");
  149. scanf("%d", &SAssessment[counter][1]);
  150. printf("\nPlease rate his/her reading level: ( ? / 10 )\n");
  151. scanf("%d", &SAssessment[counter][2]);
  152. printf("\nPlease rate his/her writing level: ( ? / 10 )\n");
  153. scanf("%d", &SAssessment[counter][3]);
  154. printf("\nPlease rate his/her participation level: ( ? / 10 )\n");
  155. scanf("%d", &SAssessment[counter][4]);
  156. printf("\nPlease enter his/her IQ result:\n");
  157. scanf("%d", &SAssessment[counter][5]);
  158. printf("\nPlease rate his/her cleaning skills:\n");
  159. scanf("%d", &SAssessment[counter][6]);
  160. printf("\nPlease rate his/her leadership skills:\n");
  161. scanf("%d", &SAssessment[counter][7]);
  162. printf("\nOther Notes?: (Y/N)\n");
  163. scanf("\n%c", &othernotes);
  164. if(othernotes == 'Y' || othernotes == 'y')
  165. {
  166. printf("\nPlease enter your notes with each word separated with an underscore");
  167. scanf("%s", SNotes[counter]);
  168. }
  169. else
  170. {
  171. printf("\n\nWould you like to add another assessment for a student? (Y/N)\n");
  172. scanf("\n%c", &addagain);
  173. if(addagain == 'Y' || addagain == 'y')
  174. {
  175. counter++;
  176. continue;
  177. }
  178. else if(addagain == 'N' || addagain == 'n')
  179. break;
  180. }
  181. }
  182. break;
  183. }
  184. default:
  185. {
  186. printf("\nInvalid input.\n\n");
  187. continue;
  188. }
  189. }
  190. printf("\nWould you like to do anything else? (Y/N)\n");
  191. scanf("\n%c", &redo);
  192. }
  193. while(redo == 'Y' || redo == 'y');
  194. }
  195. void modify(int SInfo[100][6], int TInfo[100][7], int CInfo[3][3], int TAssessment[100][6], int SAssessment[100][8], char TNotes[256][256], char SNotes[256][256])
  196. {
  197. int choice; int serialnum; char modifyagain = 'a'; int classnum; char othernotes = 'a'; char redo = 'a';
  198. do
  199. {
  200. printf("\nWhat would you like to modify?\n1- A student and his/her information.\n2- A teacher and his/her information.\n3- A class' information.\n4- A teacher's assessment.\n5- A student's assessment.\n");
  201. scanf("%d", &choice);
  202. switch (choice)
  203. {
  204. case 1:
  205. {
  206. do
  207. {
  208. printf("\nPlease enter the student's serial number:\n");
  209. scanf("%d", &serialnum);
  210. printf("\nPlease enter the student's ID:\n"); //could be name later if I felt like it
  211. scanf("%d", &SInfo[serialnum][0]);
  212. printf("\nPlease enter the student's age:\n");
  213. scanf("%d", &SInfo[serialnum][1]);
  214. printf("\nPlease enter the student's gender: (1 for Male/ 0 for Female)\n");
  215. scanf("%d", &SInfo[serialnum][2]);
  216. printf("\nPlease enter the student's address:\n"); //it's gonna be a string later on just adding headlines
  217. scanf("%d", &SInfo[serialnum][3]);
  218. printf("\nPlease enter the student's telephone number:\n");
  219. scanf("%d", &SInfo[serialnum][4]);
  220. printf("please enter this student's fees' payment:\n");
  221. scanf("%d", &SInfo[serialnum][5]);
  222. printf("\nWould you like to modify another student's information? (Y/N)\n");
  223. scanf("\n%c", &modifyagain);
  224. }
  225. while(modifyagain == 'Y' || modifyagain == 'y');
  226. break;
  227. }
  228. case 2:
  229. {
  230. do
  231. {
  232. printf("\nPlease enter the teacher's serial number:\n");
  233. scanf("%d", &serialnum);
  234. printf("\nPlease enter the teacher's ID:\n"); //could be name later if I felt like it
  235. scanf("%d", &TInfo[serialnum][0]);
  236. printf("\nPlease enter the teacher's age:\n");
  237. scanf("%d", &TInfo[serialnum][1]);
  238. printf("\nPlease enter the teacher's gender: (1 for Male/ 0 for Female)\n");
  239. scanf("%d", &TInfo[serialnum][2]);
  240. printf("\nPlease enter the teacher's Educational Level:\n"); //it's gonna be a string later on just adding headlines
  241. scanf("%d", &TInfo[serialnum][3]);
  242. printf("\nPlease enter the teacher's telephone number:\n");
  243. scanf("%d", &TInfo[serialnum][4]);
  244. printf("\nPlease enter the teacher's Specialist address:\n");
  245. scanf("%d", &TInfo[serialnum][5]);
  246. printf("\nPlease enter the teacher's university:\n"); //it's gonna be a string
  247. scanf("%d", &TInfo[serialnum][6]);
  248. printf("\nWould you like to modify another teacher's information?\n");
  249. scanf("\n%c", &modifyagain);
  250. }
  251. while(modifyagain == 'Y' || modifyagain == 'y');
  252. break;
  253. }
  254. case 3:
  255. {
  256. do
  257. {
  258. printf("\nPlease enter which KG class would you like to modify: (1/2/3)\n");
  259. scanf("%d", &classnum);
  260. printf("\nPlease enter KG%d's teacher's ID:\n",classnum); //might make it a string
  261. scanf("%d", &CInfo[classnum-1][0]);
  262. printf("\nPlease enter KG%d's location:\n", classnum);
  263. scanf("%d", &CInfo[classnum-1][1]);
  264. printf("\nPlease enter KG%d's number of students:\n", classnum);
  265. scanf("%d", &CInfo[classnum-1][2]);
  266. printf("\nWould you like to modify another class' information?\n");
  267. scanf("\n%c", &modifyagain);
  268. }
  269. while(modifyagain == 'Y' || modifyagain == 'y');
  270. break;
  271. }
  272. case 4:
  273. {
  274. while(1)
  275. {
  276. printf("\nPlease enter the serial number of the teacher you want to modify his/her assessment: (from the assessment table)\n");
  277. scanf("%d", &serialnum);
  278. printf("\nPlease enter the teacher's ID that you want to modify the assessment for:\n"); //could be name later if I felt like it
  279. scanf("%d", &TAssessment[serialnum][0]);
  280. printf("\nPlease rate his/her teaching skills: ( ? / 10 )\n");
  281. scanf("%d", &TAssessment[serialnum][1]);
  282. printf("\nPlease rate his/her preparation for class: ( ? / 10 )\n");
  283. scanf("%d", &TAssessment[serialnum][2]);
  284. printf("\nPlease rate his/her interaction with students: ( ? / 10 )\n");
  285. scanf("%d", &TAssessment[serialnum][3]);
  286. printf("\nPlease rate his/her use of technology in teaching: ( ? / 10 )\n");
  287. scanf("%d", &TAssessment[serialnum][4]);
  288. printf("\nPlease rate his/her attendance: ( ? / 10 )\n");
  289. scanf("%d", &TAssessment[serialnum][5]);
  290. scanf("\n%c", &othernotes);
  291. if(othernotes == 'Y' || othernotes == 'y')
  292. {
  293. printf("\nPlease enter your notes with each word separated with an underscore");
  294. scanf("%s", TNotes[serialnum]); // Not sure how this works I'll leave it to you saif
  295. }
  296. else
  297. {
  298. printf("\n\nWould you like to modify another assessment for a teacher? (Y/N)\n");
  299. scanf("\n%c", &modifyagain);
  300. if(modifyagain == 'Y' || modifyagain == 'y')
  301. {
  302. continue;
  303. }
  304. else if(modifyagain == 'N' || modifyagain == 'n')
  305. break;
  306. }
  307. }
  308. break;
  309. }
  310. case 5:
  311. {
  312. while(1)
  313. {
  314. printf("\nPlease enter the serial number of the student you want to modify his/her assessment: (from the assessment table)\n");
  315. scanf("%d", &serialnum);
  316. printf("\nPlease enter the student's ID that you want to modify the assessment for:\n"); //could be name later if I felt like it
  317. scanf("%d", &SAssessment[serialnum][0]);
  318. printf("\nPlease rate his/her attendance: ( ? / 10 )\n");
  319. scanf("%d", &SAssessment[serialnum][1]);
  320. printf("\nPlease rate his/her reading level: ( ? / 10 )\n");
  321. scanf("%d", &SAssessment[serialnum][2]);
  322. printf("\nPlease rate his/her writing level: ( ? / 10 )\n");
  323. scanf("%d", &SAssessment[serialnum][3]);
  324. printf("\nPlease rate his/her participation level: ( ? / 10 )\n");
  325. scanf("%d", &SAssessment[serialnum][4]);
  326. printf("\nPlease enter his/her IQ result:\n");
  327. scanf("%d", &SAssessment[serialnum][5]);
  328. printf("\nPlease rate his/her cleaning skills:\n");
  329. scanf("%d", &SAssessment[serialnum][6]);
  330. printf("\nPlease rate his/her leadership skills:\n");
  331. scanf("%d", &SAssessment[serialnum][7]);
  332. printf("\nOther Notes?: (Y/N)\n");
  333. scanf("\n%c", &othernotes);
  334. if(othernotes == 'Y' || othernotes == 'y')
  335. {
  336. printf("\nPlease enter your notes with each word separated with an underscore");
  337. scanf("%s", SNotes[serialnum]);
  338. }
  339. else
  340. {
  341. printf("\n\nWould you like to modify another assessment for a student? (Y/N)\n");
  342. scanf("\n%c", &modifyagain);
  343. if(modifyagain == 'Y' || modifyagain == 'y')
  344. {
  345. continue;
  346. }
  347. else if(modifyagain == 'N' || modifyagain == 'n')
  348. break;
  349. }
  350. }
  351. break;
  352. }
  353. default:
  354. {
  355. printf("\nInvalid input.\n\n");
  356. continue;
  357. }
  358. printf("\nWould you like to do anything else? (Y/N)\n");
  359. scanf("\n%c", &redo);
  360. }
  361. }
  362. while(redo == 'Y' || redo == 'y');
  363. }
  364. void delete(int SInfo[100][6], int TInfo[100][7], int CInfo[3][3], int TAssessment[100][6], int SAssessment[100][8], char TNotes[256][256], char SNotes[256][256])
  365. {
  366. int choice; int serialnum; char delagain = 'a'; char redo = 'a';
  367. do
  368. {
  369. printf("\nWhat would you like to delete?\n1- A student and his/her information.\n2- A teacher and his/her information.\n3- A class' information.\n4- A teacher's assessment.\n5- A student's assessment.\n");
  370. scanf("%d", &choice);
  371. switch (choice)
  372. {
  373. case 1:
  374. {
  375. do
  376. {
  377. printf("\nPlease enter the student's serial number:\n");
  378. scanf("%d", &serialnum);
  379. for(int i = 0; i < 6; i++)
  380. {
  381. SInfo[serialnum][i] = 0; //I replaced the arbitrary symbol with 0 because I don't know how to convert an int array to a character LOL
  382. }
  383. printf("/nWould you like to delete anything else? (Y/N)\n");
  384. scanf("\n%c", &delagain);
  385. }
  386. while(delagain == 'Y' || delagain == 'y');
  387. break;
  388. }
  389. case 2:
  390. {
  391. do
  392. {
  393. printf("\nPlease enter the teacher's serial number:\n");
  394. scanf("%d", &serialnum);
  395. for(int i = 0; i < 7; i++)
  396. {
  397. TInfo[serialnum][i] = 0;
  398. }
  399. printf("/nWould you like to delete anything else? (Y/N)\n");
  400. scanf("\n%c", &delagain);
  401. }
  402. while(delagain == 'Y' || delagain == 'y');
  403. break;
  404. }
  405. case 3:
  406. {
  407. do
  408. {
  409. printf("\nPlease enter the KG class' number: (1/2/3)\n");
  410. scanf("%d", &serialnum);
  411. for(int i = 0; i < 3; i++)
  412. {
  413. CInfo[serialnum][i] = 0;
  414. }
  415. printf("/nWould you like to delete anything else? (Y/N)\n");
  416. scanf("\n%c", &delagain);
  417. }
  418. while(delagain == 'Y' || delagain == 'y');
  419. break;
  420. }
  421. case 4:
  422. {
  423. do
  424. {
  425. printf("\nPlease enter the teacher's serial number:\n");
  426. scanf("%d", &serialnum);
  427. for(int i = 0; i < 7; i++)
  428. {
  429. TInfo[serialnum][i] = 0;
  430. TNotes[serialnum] = '&';
  431. }
  432. printf("/nWould you like to delete anything else? (Y/N)\n");
  433. scanf("\n%c", &delagain);
  434. }
  435. while(delagain == 'Y' || delagain == 'y');
  436. break;
  437. }
  438. case 5:
  439. {
  440. do
  441. {
  442. printf("\nPlease enter the student's serial number:\n");
  443. scanf("%d", &serialnum);
  444. for(int i = 0; i < 8; i++)
  445. {
  446. SInfo[serialnum][i] = 0;
  447. SNotes[i] = '&';
  448. }
  449. printf("/nWould you like to delete anything else? (Y/N)\n");
  450. scanf("\n%c", &delagain);
  451. }
  452. while(delagain == 'Y' || delagain == 'y');
  453. break;
  454. }
  455. default:
  456. {
  457. printf("\nInvalid input.\n\n");
  458. continue;
  459. }
  460. printf("\nWould you like to do anything else? (Y/N)\n");
  461. scanf("\n%c", &redo);
  462. }
  463. }
  464. while(redo == 'Y' || redo == 'y');
  465. }
  466. void assessmentteacher(int TAssessment[100][6], char TNotes[256][256])
  467. {
  468. int serialnum;
  469. printf("\nPlease enter the serial number for the teacher you want to print the assessment for:\n");
  470. scanf("%d", &serialnum);
  471. printf("\n\nName\tTeaching Skills\tPreperation for class\tInteraction with students\tUsing technology in teaching\tAttendence\tOther Notes\n");
  472. for(int i = 0; i < 6; i++)
  473. {
  474. printf("%d\t", TAssessment[serialnum][i]);
  475. }
  476. printf("%s\n", TNotes);
  477. }
  478. void assessmentstudent(int SAssessment [100][8], char SNotes[256][256])
  479. {
  480. int serialnum;
  481. printf("\nPlease enter the serial number for the student you want to print the assessment for:\n");
  482. scanf("%d", &serialnum);
  483. printf("\n\nName\tAttendence Level\tReading Level\tWriting Level\tParticipation Level\tIQ Result\tCleaning Skills\tLeadership Skills\tOther Notes\n");
  484. for(int i = 0; i < 8; i++)
  485. {
  486. printf("%d\t", SAssessment[serialnum][i]);
  487. }
  488. printf("%s\n", SNotes);
  489. }
  490. int searchstudent(int SInfo[100][6])
  491. {
  492. int SID; int address;
  493. printf("\nPlease enter the teacher's ID number:\n");
  494. scanf("%d", &SID);
  495. for(int i = 0; i < 100; i++)
  496. {
  497. if(SID == SInfo[i][1])
  498. return i;
  499. }
  500. }
  501. int searchteacher(int TInfo[100][7])
  502. {
  503. int TID; int address;
  504. printf("\nPlease enter the teacher's ID number:\n");
  505. scanf("%d", &TID);
  506. for(int i = 0; i < 100; i++)
  507. {
  508. if(TID == TInfo[i][1])
  509. return i;
  510. }
  511. }
  512. void login(char user[256], char pass[256])
  513. {
  514. char admin[6] = {'a','d','m','i','n'}; char password[6] = {'1','2','3','2','1'};
  515. while (1)
  516. {
  517. printf("Please enter your username:\n");
  518. scanf("%s", user);
  519. if(user != admin)
  520. {
  521. printf("Invalid Username!\n");
  522. continue;
  523. }
  524. else if(user == admin)
  525. {
  526. break;
  527. }
  528. }
  529. while(1)
  530. {
  531. printf("\nPlease enter your password:\n");
  532. scanf("%s", pass);
  533. if(pass != password)
  534. {
  535. printf("Invalid Password!\n");
  536. continue;
  537. }
  538. else if(pass == password)
  539. {
  540. admin();
  541. }
  542. }
  543. }
  544. void admin()
  545. {
  546. int StudentInfo[100][6], TeacherInfo[100][7], classinfo[3][3], studentassessment[100][8], teacherassessment[100][6]; //char StName[256][256]
  547. int choice; char delchoice = 'a'; char search = 'a'; char searchagain = 'a'; char assessment = 'a';
  548. char assessmentagain = 'a'; char paymentchoice = 'a'; char redo = 'a';
  549. char SNotes[256][256]; char TNotes[256][256];
  550. int searchresult; char tables = 'a';
  551. while(1)
  552. {
  553. printf("What would you like to do?\n1- Add/Modify/Delete data.\n2- Search for a student or a teacher.\n3- Print assessment report for teacher/student.\n4- Print the payment info of a student.\n");
  554. scanf("%d", &choice);
  555. if(choice == 1)
  556. {
  557. printf("\nWhat would you like to do? (A/M/D)\n");
  558. scanf("\n%c", &delchoice);
  559. if(delchoice == 'A' || delchoice == 'a')
  560. {
  561. add(StudentInfo, TeacherInfo, classinfo, studentassessment, teacherassessment, SNotes, TNotes);
  562. }
  563. else if(delchoice == 'M' || delchoice == 'm')
  564. {
  565. modify(StudentInfo, TeacherInfo, classinfo, studentassessment, teacherassessment, SNotes, TNotes);
  566. }
  567. else if(delchoice == 'D' || delchoice == 'd')
  568. {
  569. delete(StudentInfo, TeacherInfo, classinfo, studentassessment, teacherassessment, SNotes, TNotes);
  570. }
  571. }
  572. else if(choice == 2)
  573. {
  574. do
  575. {
  576. printf("\nWhat would you like to search for? (S/T)\n");
  577. scanf("\n%c", &search);
  578. if(search == 'S' || search == 's')
  579. {
  580. searchresult = searchstudent(StudentInfo);
  581. printf("\nThis student's serial number is %d\n", searchresult);
  582. }
  583. else if(search == 'T' || search == 't')
  584. {
  585. searchresult = searchteacher(TeacherInfo);
  586. printf("\nThis teacher's serial number is %d\n", searchresult);
  587. }
  588. printf("\nWould you like to search for anything else? (Y/N)\n");
  589. scanf("\n%c", &searchagain);
  590. }
  591. while(searchagain == 'Y' || searchagain == 'y');
  592. }
  593. else if(choice == 3)
  594. {
  595. do
  596. {
  597. printf("\nWho would you like to print the assessment for? (S/T)\n");
  598. scanf("\n%c", &assessment);
  599. if(assessment == 'S' || assessment == 's')
  600. {
  601. assessmentstudent(studentassessment, SNotes);
  602. }
  603. else if(assessment == 'T' || assessment == 't')
  604. {
  605. assessmentteacher(teacherassessment, TNotes);
  606. }
  607. printf("\nWould you like to print another assessment? (Y/N)\n");
  608. scanf("\n%c", &assessmentagain);
  609. }
  610. while(assessmentagain == 'y' || assessmentagain == 'Y');
  611. }
  612. else if(choice == 4)
  613. {
  614. do
  615. {
  616. payment(StudentInfo);
  617. printf("\nWould you like to print the payment info for another student? (Y/N)\n");
  618. scanf("\n%c", &paymentchoice);
  619. }
  620. while(paymentchoice == 'Y' || paymentchoice == 'y');
  621. }
  622. printf("\nWould you like to do anything else? (Y/N)\n");
  623. scanf("\n%c", &redo);
  624. if(redo == 'Y' || redo == 'y')
  625. continue;
  626. else
  627. {
  628. printf("\nWould you like to print the tables? (Y/N)\n");
  629. scanf("\n%c", &tables);
  630. if(tables == 'Y' || tables == 'y')
  631. {
  632. printf("\nThe students information table:\n\n");
  633. printf("ID\tAge\tGender\tAddress\tTelephone No.\tFee's Payment\n");
  634. for(int i = 0; i < 100; i++)
  635. {
  636. for(int j = 0; j < 6; j++)
  637. {
  638. printf("%d\t", StudentInfo[i][j]);
  639. }
  640. printf("\n");
  641. }
  642. printf("\n\nThe Teachers information table:\n\n");
  643. printf("ID\tAge\tGender\tEducational Level\tUniversity\tSpecialist Address\tTelephone No.\n");
  644. for(int i = 0; i < 100; i++)
  645. {
  646. for(int j = 0; j < 7; j++)
  647. {
  648. printf("%d\t", TeacherInfo[i][j]);
  649. }
  650. printf("\n");
  651. }
  652. }
  653. else
  654. break;
  655. }
  656. }
  657. return;
  658. }
  659. int main()
  660. {
  661. char user[256]; char pass[256];
  662. login(user, pass);
  663. return 0;
  664. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement