From 2fb09646abb58049b176ee47e67ace25b3a86aa1 Mon Sep 17 00:00:00 2001 From: Rumeet Date: Sun, 10 Jul 2016 22:39:10 -0400 Subject: [PATCH 1/2] Rumeet Goradia - Final Project Proposal --- proposal.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 proposal.txt diff --git a/proposal.txt b/proposal.txt new file mode 100644 index 0000000..5516bc2 --- /dev/null +++ b/proposal.txt @@ -0,0 +1,3 @@ +Rumeet Goradia +Many school districts utilize an online software that helps teachers and school administrators keep track of their students' grades. These programs, like Genesis, also allow easy maneuverability through class rosters and attendance records. +My custom program will attempt to mimic these online educational services. The user will be an elementary school teacher for a small school with one teacher per grade (kindergarten to fifth grade); the user will get to "log-in" as the teacher he/she wishes to be, and all relevant data (like the teacher's name, the grade, the class roster, etc.) would be called using a switch statement. The user would be asked to login with a string password, which will be the password until the user ends the program or logs out. The user would have to enter this same password every time he/she makes a change to the grades. The students' data would be organized using structure data types. The user will have the option to input commands. Since there are multiple students, this structure data type would be used in conjunction with an array. For instance, he/she can enter "show roster" to see the data for all the students, and a separate function will print the roster. Moreover, the user can select to view the details of a specific student, including name, age, address, and grades in each class, which will be printed with the help of a function. The user can also enter "help" to see all the commands he/she can enter, and a custom function will print out a list of commands. Of course, there will have to be code to make sure the input is a valid command. The other major input mechanic will be putting in grades. The user can first select a subject, and using a combination of an ENUM list and a switch statement, he/she will input grades (and also input whether the assignment was a test, quiz, classwork, or homework, which will affect the weight of the assignment), and the subject's average for each student will be calculated using a separate function. There would be many uses for loops in the program, usually for the repetition of each function. The whole program would probably run on a while loop, and it would run until the user entered a specific string, like "log out". From 3b9e44c5ddf684b4dfce3b37dd2a954bad14486f Mon Sep 17 00:00:00 2001 From: Rumeet Date: Fri, 15 Jul 2016 16:04:45 -0400 Subject: [PATCH 2/2] CarrotCore v1 -- Updates soon to come --- carrotcore | Bin 0 -> 16352 bytes carrotcore.c | 377 ++++++++++++++++++++++++++++++++++++++++++++++ fifthgrade2.txt | 73 +++++++++ firstgrade2.txt | 79 ++++++++++ fourthgrade2.txt | 58 +++++++ kindergarten2.txt | 55 +++++++ readme.txt | 7 + secondgrade2.txt | 64 ++++++++ thirdgrade2.txt | 70 +++++++++ 9 files changed, 783 insertions(+) create mode 100755 carrotcore create mode 100644 carrotcore.c create mode 100644 fifthgrade2.txt create mode 100644 firstgrade2.txt create mode 100644 fourthgrade2.txt create mode 100644 kindergarten2.txt create mode 100644 readme.txt create mode 100644 secondgrade2.txt create mode 100644 thirdgrade2.txt diff --git a/carrotcore b/carrotcore new file mode 100755 index 0000000000000000000000000000000000000000..c6dbe5c3232a386dcc26317b4588c4348c8ef699 GIT binary patch literal 16352 zcmeHOeRx#WnLm?EaEdVrlv+f(y;W$#E)EGFBG@7!xezo!OoHeF4wK9zcVIG;&fEdg z^#dIvOowc&Ma)Q8=w4T1!_^l4VvZm_n+O5K}+l`0Btsk6V|IddmB zV?ccBpBy-O&--!S^S{1{K1+iWCyFD`jJ=ZJFOreR7h;s2s zF;R>HiM*McAcLx*18WgzZq!25Cg4r?xIL^N1RN-!amgo#S9{x*`#Hq0 z@(l+z7VVXJ_?>z9kMi(D9&Y5}jd^%?9?m?m3&;POjQ|qgmWN|nbA|lg9H!zFap2_t zTOK|k57+bX<~&@>!!HGXV!PYJ`51%QUIMtL*T$h8bKAl>y;k@ZFZ0FCKq%r%#Df9R z8tn*1gwGd>M_cC1@x@#Gkyg=>Fyo-bO@GTeUyHHM*Xj?2No_IwF(G>kGa8O=2*yN5 zEEF+YMQdBoY>|KC5Qv4LloZP6l(#DFtu5hbJSf`z;c&Et!YzJNg7yx`(o&8bGkxv; zP(-xGf;NYgOi2vvaKq2B`r53gut6+{i#e=A^>;m)DL0 zRJY7gI~m7?LYFaPe+F67#z@>Pj%4wVOT19Ln#Ic`ULalv&T^Oj<8sW&k~jh zF`uv$*A7A$UQ0Meh&nmki9_s-ZbkDvg<_eKcp3P)3UA<9H*!@C9!0mzWO`+gH`p(6dS@_fgS`@`m&SPFyChC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g*uWn#HbXpDBtnG_~D13hD2s&Pc98nDn#~aa6Egq$;m?AU?6pZNuIA7&K!2U39|91 z5ASpW4BzncTIy`o@XmQhrbb|L>Nx+f87IG-0`mOV5TVjOfyQjFvJI53@_;*uNoa;Q+Q=ey=Z#dqCm|cUgUVW&LI<(ndJ={*_CYs zpu)yfSGB}d54*hoVa}V7Fxq7sn;{ug?HtwV;$9tQ{AV+&_ee{7pFiBL(EkNa-dp8(8 zXj6_mQ(JB;+O(D9@VBW30*t*~D95rH)t2KPy#sRc9fss88z}o_haC6rJD^zp;AQ3P z_SYP8{LS74xvSKcT1wIo=4SIA@Ky*zc< t< +#include +#include +#include +#include + + + + +char *splitString(char*ptrS, char c) { //Used for splitting first and last names read from file + while(*ptrS !=c) { + ptrS++; + } + return ptrS; +} + +void clrscr(){//Simulates screen clearing by creating a bunch of new lines + int i6; + for (i6=0;i6<45;i6++) + { + printf("\n"); + } +} +void help (){ //Prints main menu + printf("\n[1] CHECK ROSTER\n[2] ENTER GRADE\n[3] STUDENT DATA\n[4] TEACHER DATA\n[5] LOG OUT\n\n"); +} + +void subjects (){ //Prints subjects menu + printf("\n[1] MATH\n[2] ENGLISH\n[3] SCIENCE\n[4] HISTORY\n[5] SPANISH\n\n"); +} + +void assigntype(){ //Prints types of assignments + printf("\n[1] TEST/PROJECT\n[2] QUIZ\n[3] CLASSWORK\n[4] HOMEWORK\n\n"); +} + +typedef struct { + float *gradesEng; + float avgEng; + float *gradesMath; + float avgMath; + float *gradesSci; + float avgSci; + float *gradesHist; + float avgHist; + float *gradesSpan; + float avgSpan; +} grades; +typedef struct { + char *fname; + char *lname; + char *address; + char *birthday; + grades grad; +} student; + +typedef struct{ + char *fname; + char *lname; + char *birthday; + char *grade; + char *email; + char *title; +} teacher; + +void roster (char *arr[], char *arr2[], char *bdays[], char *adds[], int lim){ + int j1, j2; + int greatnesf; + char **lnamef; + char **fnamef; + char **bdayf; + char **addref; + for(j1=0; j10) + { + greatnesf++; + } + } + lnamef[greatnesf]=arr[j1]; + fnamef[greatnesf]=arr2[j1]; + bdayf[greatnesf]=bdays[j1]; + addref[greatnesf]=adds[j1]; + strcat(lnamef[greatnesf], ", "); + strcat(lnamef[greatnesf], fnamef[greatnesf]); + + } + + printf(" Name: Address: Date of Birth:\n");//Prints "Last Name, First Name Address DOB" for all students + int j3; + for (j3=0;j3\n", teachk); + printf("Joel Chapman (First Grade) <%s>\n", teach1); + printf("Niamh Parker (Second Grade) <%s>\n", teach2); + printf("Hannah Lyons (Third Grade) <%s>\n", teach3); + printf("Christopher Law (Fourth Grade) <%s>\n", teach4); + printf("Mitchell Davis (Fifth Grade) <%s>\n\n", teach5); + char *user=(char*) malloc(35); + char *pass=(char*) malloc(sizeof(char)*100); + int i1; + do { + printf("Username: "); + printf("%u\n",sizeof(user)); + fgets(user, sizeof(user), stdin); + printf("%s\n", user); + user[strlen(user)-1]='\0'; + for (i1=0; i1<35; i1++) + { + user[i1]=tolower(user[i1]); + }//function "tolower" used to make all input lowercase + printf("%s\n", user); + printf("Password: "); + fgets(pass, sizeof(pass),stdin); + pass[strlen(pass)-1]='\0'; + if(strcmp(user, teachk)!=0 && strcmp(user, teach1)!=0 && strcmp(user, teach2)!=0 && strcmp(user, teach3)!=0 && strcmp(user, teach4)!=0 && strcmp(user, teach5)!=0) + { + printf("Invalid username. Please login with a certified Pikachu School District email.\n"); + + } + } while(strcmp(user, teachk)!=0 && strcmp(user, teach1)!=0 && strcmp(user, teach2)!=0 && strcmp(user, teach3)!=0 && strcmp(user, teach4)!=0 && strcmp(user, teach5)!=0); + FILE *class; + teacher teach; + switch (user[0])//first letter of username input decides teacher profile and class roster + { + case 's': + class=fopen("kindergarten2.txt", "r"); + teach.fname="Sienna"; + teach.lname="Spencer"; + teach.birthday="5/31/1985"; + teach.grade="Kindergarten"; + teach.email=teachk; + teach.title="Mrs."; + break; + case 'j': + class=fopen("firstgrade2.txt", "r"); + teach.fname="Joel"; + teach.lname="Chapman"; + teach.birthday="1/28/1975"; + teach.grade="First Grade"; + teach.email=teach1; + teach.title="Mr."; + break; + case 'n': + class=fopen("secondgrade2.txt", "r"); + teach.fname="Niamh"; + teach.lname="Parker"; + teach.birthday="10/10/1961"; + teach.grade="Second Grade"; + teach.email=teach2; + teach.title="Mrs."; + break; + case 'h': + class=fopen("thirdgrade2.txt", "r"); + teach.fname="Hannah"; + teach.lname="Lyons"; + teach.birthday="12/14/1955"; + teach.grade="Third Grade"; + teach.email=teach3; + teach.title="Mrs."; + break; + case 'c': + class=fopen("fourthgrade2.txt", "r"); + teach.fname="Christopher"; + teach.lname="Law"; + teach.birthday="3/2/1969"; + teach.grade="Fourth Grade"; + teach.email=teach4; + teach.title="Mr."; + break; + case 'm': + class=fopen("fifthgrade2.txt", "r"); + teach.fname="Mitchell"; + teach.lname="Davis"; + teach.birthday="12/22/1977"; + teach.grade="Fifth Grade"; + teach.email=teach5; + teach.title="Mr."; + break; + } + + + int num; + fscanf(class,"%d", &num);//first line of each file is number of students + student stud[num]; + int i; + fgetc(class); + char *wholeName=(char*)malloc(sizeof(char)*100); + char *address=(char*)malloc(sizeof(char)*100); + char *birthday=(char*)malloc(sizeof(char)*12); + int lnamelength=0, fnamelength=0, bdaylength=0, addlength=0; + for (i=0; i