Skip to content

Commit 55f50d9

Browse files
committed
Added Old Projects
0 parents  commit 55f50d9

File tree

167 files changed

+645704
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+645704
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
bash scoreall >> $1;
3+
cat $1;
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include<stdio.h>
2+
#include<fstream>
3+
/******Marking Scheme******/
4+
const int posScore=4;
5+
const int negScore=0;
6+
const int maxq=40; //Maxmimum no. of questions
7+
const int ans[maxq]={1,4,2,3,2};//put correct answers here
8+
9+
10+
using namespace std;
11+
int main(int v,char *file[])
12+
{ int i;
13+
if(v!=2) {printf("Error!\n");return -1;}
14+
char ch;
15+
int ques,res;
16+
ifstream fin(file[1]);
17+
int myans[maxq]={0};
18+
int score=0;
19+
20+
while(fin)
21+
{
22+
fin>>ch;
23+
fin>>ques;
24+
fin>>ch;
25+
fin>>res;
26+
fin>>ch;
27+
fin>>ch;
28+
fin>>ch;
29+
fin>>ch;
30+
if(ques<1 || ques>40) {printf("Error!\n");return -1;}
31+
myans[ques-1]=res;
32+
}
33+
fin.close();
34+
35+
/*********Print the input*****
36+
for(i=0;i<maxq;i++)
37+
printf("%d => %d\n",i+1,myans[i]);
38+
*/
39+
for(i=0;i<maxq;i++)
40+
if(myans[i]!=0)
41+
if(myans[i]==ans[i])
42+
score+=posScore;
43+
else
44+
score+=negScore;
45+
46+
printf("%40s => %d\n",file[1],score);
47+
return 0;
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include<stdio.h>
2+
#include<fstream>
3+
/******Marking Scheme******/
4+
const int posScore=4;
5+
const int negScore=0;
6+
const int maxq=40; //Maxmimum no. of questions
7+
const int ans[maxq]={1,4,2,3,2};//put correct answers here
8+
9+
10+
using namespace std;
11+
int main(int v,char *file[])
12+
{ int i;
13+
if(v!=2) {printf("Error!\n");return -1;}
14+
char ch;
15+
int ques,res;
16+
ifstream fin(file[1]);
17+
int myans[maxq]={0};
18+
int score=0;
19+
20+
while(fin)
21+
{
22+
fin>>ch;
23+
fin>>ques;
24+
fin>>ch;
25+
fin>>res;
26+
fin>>ch;
27+
fin>>ch;
28+
fin>>ch;
29+
fin>>ch;
30+
if(ques<1 || ques>40) {printf("Error!\n");return -1;}
31+
myans[ques-1]=res;
32+
}
33+
fin.close();
34+
35+
/*********Print the input*****
36+
for(i=0;i<maxq;i++)
37+
printf("%d => %d\n",i+1,myans[i]);
38+
*/
39+
for(i=0;i<maxq;i++)
40+
if(myans[i]!=0)
41+
if(myans[i]==ans[i])
42+
score+=negScore;
43+
else
44+
score+=negScore;
45+
46+
printf("%40s => %d\n",file[1],score);
47+
return 0;
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
for f in *.html;do
3+
./score "$f";
4+
done;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
q2. 2<br>q3. 3<br>q4. 1<br>q5. 3<br>q6. 2<br>q7. 1<br>q8. 3<br>q9. 2<br>q10. 3<br>q11. 2<br>q12. 1<br>q13. 2<br>q14. 1<br>q15. 4<br>q16. 2<br>q17. 1<br>q18. 3<br>q19. 4<br>q20. 1<br>q21. 3<br>q22. 2<br>q23. 2<br>q24. 1<br>q25. 1<br>q26. 3<br>q27. 1<br>q28. 3<br>q29. 4<br>q30. 3<br>q31. 1<br>q32. 4<br>q33. 1<br>q34. 2<br>q35. 4<br>q36. 1<br>q37. 1<br>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
bash scoreall >> $1;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
for f in *.html;do
3+
echo ./score "$f";
4+
done;

0 commit comments

Comments
 (0)