Sample Online Test

Instructions : 
	1. Mail your programs as attachments to cs296@cse before 5.00 PM

1. You are given two datafiles. The format of the files is as follows : 

	datafile1 has following fields :
		1. Student Roll no. (Single field)
		2. Course name (Single field)
		3. Marks for some quizzes (Multiple fields)

	eg. 01305001 IT642 10 10 8 9 

	datafile2 has the following format :
		1. Instructor name (single field)
		2. Course name (Single field)
		3. Weightage for the quizzes (Multiple fields)

	eg. Sivakumar CS296 0.3 0.3 0.2 0.2	

	One course is taught by only one instructor and one instructor teaches 
only one course.

You are given two scripts in shell and perl. They are as follows :
	Script 1 : It takes names of the datafiles and a professor name as command line arguments
	and outputs the roll numbers of the students who have taken his course.

	It can be invoked as : 
		$ findstudent.sh datafile1 datafile2 professor-name
		$ findstudent.pl datafile1 datafile2 professor-name

	You have to modify the scripts (both shell and perl)  so as to find, for each 
	instructor, the number of students taking his course.

	The script should be invoked as :
		$ findtotalstudents.sh datafile1 datafile2
		$ findtotalstudents.pl datafile1 datafile2

	The output should have the following format :
			Instructor-name		No-of-students

	There will be many lines, one for each instructor.


	Script 2 : It takes four arguments, datafile1, datafile2, student roll number 
	and course name.  It finds the total marks scored by the student. 
	The total marks are given by :

		Total marks = w1*m1 + w2*m2 + ....

		where w1 = Weightage for quiz 1.
		      m1 = Marks in quiz 1. And so on..	

	It can be invoked as :
		$ findtotal.sh datafile1 datafile2 student-rollno course-name
		$ findtotal.pl datafile1 datafile2 student-rollno course-name

	You have to modify the scripts such that, given a course name, find the maximum marks 
	scored in that course.	

	The script should be invoked as :
		$ maxmarks.sh datafile1 datafile2 course-name
		$ maxmarks.pl datafile1 datafile2 course-name

2.Given is a java applet which works as follows :

	* There is dropdown of functions . 
	* After selecting the function the java applet plots the the function in the domain (range of x values ) provided.

	Modify the  applet to do the following: 

	* You  have been given 2 functions f1 and f2. 
	* Add to the drop-down menu entry 'f1 and f2'.
	* Plot the functions f1 and f2 simultaneously on screen for the given range of 'x' values with different colors, when the entry is selected.


Download the following files.
findtotal.sh
findstudent.sh
findtotal.pl
findstudent.pl

datafile1

datafile2

Download the following java file. Compile it as
$javac SimplePlot.java
and then run it using appletviewer as
$appletviewer SimplePlot.html

SimplePlot.java