You are on page 1of 21

Systems programming and Operating System

Slip 1 40. Write a command line program for line editor. The file to be edited is taken as command line argument; an empty file is opened for editing if no argument is supplied. It should display $ prompt to accept the line editing commands. Implement the following commands. 41. a - to append 42. p - to print 43. p m, n - to range of line printing 44. s - to save 45. Write the simulation program for demand paging and show the page scheduling and total number of page faults according to FIFO page replacement algorithm. Assume memory of n frames. Request Page Numbers: 9,14,10, 11, 15, 9, 11, 9, 15, 10, 9, 15, 10, 12, 15 Slip 2 46. Write a command line program for line editor. The file to be edited is taken as command line argument; an empty file is opened for editing if no argument is supplied. It should display $ prompt to accept the line editing commands. Implement the following commands. 47. a - to append 48. d n - to delete nth line 49. d m,n - to delete range of lines 50. f <pat> - to search pattern 51. Write the simulation program for preemptive scheduling algorithm using SJF. The arrival time and first CPU bursts of different jobs should be input to the system. Assume the fixed I/O waiting time (2 units). The next CPU burst should be generated using random function. The output should give the Gantt chart, Turnaround Time and Waiting time for each process and average times. Slip 3 52. Write a MACRO PREPROCESSOR for SMAC0, which reads a macro definition & main program in which macro is called. Your program should display SMAC0 program with expanded macro. Consider only positional parameters. INPUT OUTPUT MACRO CALC &X, &Y, &Z READ A MOVER AREG, &X READ B ADD AREG, &Y READ C SUB AREG, &Z MOVER AREG, A MOVEM AREG, &X ADD AREG, B MEND SUB AREG, C READ A MOVEM AREG, A READ B PRINT A READ C PRINT B CALC A, B, C STOP PRINT A A DS 1 PRINT B B DS 1 STOP C DS 1 A DS 1 B DS 1 C DS 1 53. Write a simulation program for disk scheduling using SCAN algorithm. Accept total number of disk blocks, disk request string, direction of head moment and current

head position from the user. Display the list of request in the order in which it is served. Also display the total number of head moments. Slip 4 54. Write a MACRO PREPROCESSOR for SMAC0, which reads a macro definition & main program in which macro is called. Define a macro with any number of positional and keyword parameters. Your program should display MNT (Macro Name Table), MDT(Macro Definition Table) and KPT(Keyword Parameter Table) only. 55. Write a program that behaves like a shell (command interpreter). It has its own prompt say myshell$. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. 56. count c <filename> - print number of characters in file 57. count w <filename> - print number of words in file 58. count l <filename> - print number of lines in file Slip 5 59. Write a assembler for the error free SMAC0 program that will generate target code. 60. Write a simulation program for disk scheduling using LOOK algorithm. Accept total number of disk blocks, disk request string, direction of head moment and current head position from the user. Display the list of request in the order in which it is served. Also display the total number of head moments. Slip - 6 61. Write a command line program for line editor. The file to be edited is taken as command line argument; an empty file is opened for editing if no argument is supplied. It should display $ prompt to accept the line editing commands. Implement the following commands. 62. a - to append 63. i n - to insert after nth line 64. m n1 n2 - to move line n1 at n2 position 65. m n1 n2 n3 - to move range of lines at n3 66. Write a program that behaves like a shell (command interpreter). It has its own prompt say myshell$. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. 67. list f <dirname> - print name of all files in directory 68. list n <dirname> - print number of all entries 69. list i<dirname> - print name and inode of all files Slip - 7 70. Write a command line program for line editor. The file to be edited is taken as command line argument; an empty file is opened for editing if no argument is supplied. It should display $ prompt to accept the line editing commands. Implement the following commands. 71. a - to append 72. i n - to insert after nth line 73. c n1 n2 - to copy line n1 at n2 position 74. c n1 n2 n3 - to copy range of line at n3 75. Write a program that behaves like a shell (command interpreter). It has its own prompt say myshell$. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. 76. typeline +10 <filename> - print first 10 lines of file 77. typeline -20 <filename> - print last 20 lines of file 78. typeline a <filename> - print all lines of file

Slip - 8 79. Write a SMAC0 CPU simulator program in C for the following instruction set Mnemonic Opcode Meaning MOVER 01 Move memory operand contents to register MOVEM 02 Move register contents to memory operand READ 03 Read into memory operand PRINT 04 Print contents of memory operand COMP 05 Compare register & memory operand to set appropriate condition Code. BC 06 Branch to 2nd operator depending on condition code specified as 1 st operand. MULT 07 Multiply memory operand to register operand DIV 08 Divide memory operand to register operand ADD 09 Add memory operand to register operand SUB 10 Subtract memory operand to register operand STOP 11 Stop of halt execution Assemble following program manually and execute it using above simulator. [5 Marks] READ N MOVER AREG, N COMP AREG, ZERO BC LT, STOP1 LOOP MOVER AREG, FACT MULT AREG, I MOVEM AREG, FACT MOVER AREG, I ADD AREG, ONE COMP AREG, N BC GE, OUT1 MOVEM AREG, I BC ANY, LOOP OUT1 PRINT FACT STOP STOP1 PRINT ONE STOP N DS 1 I DC 1 ONE DC 1 FACT DC 1 ZERO DC 0 80. Consider a system with n processes and m resource types. Accept number of instances for every resource type. For each process accept the allocation and maximum requirement matrices. Write a program to check if the given request of a process can be granted immediately or not. Slip - 9 81. Write a SMAC0 CPU simulator program in C for the following instruction set. Mnemonic Opcode Meaning COMP 01 Compare register & memory operand to set appropriate condition Code. BC 02 Branch to 2nd operator depending on condition code specified as 1 st operand. DIV 03 Divide memory operand to register operand

MULT 04 Multiply memory operand to register operand ADD 05 Add memory operand to register operand SUB 06 Subtract memory operand to register operand MOVER 07 Move memory operand contents to register MOVEM 08 Move register contents to memory operand READ 09 Read into memory operand PRINT 10 Print contents of memory operand STOP 11 Stop at halt execution Assemble following program manually and execute it using above simulator. READ N LOOP MOVER AREG, PROD MULT AREG, N MOVE M AREG, PROD MOVER AREG, N SUB AREG, ONE COMP AREG, ZERO BC LE, OUT MOVEM AREG, N BC ANY, LOOP OUT PRINT PROD STOP N DS 1 ZERO DC 0 ONE DC 1 PROD DC 1 END 82. Write the simulation program for demand paging and show the page scheduling and total number of page faults according to MFU page replacement algorithm. Assume the memory of n frames. Request Page Numbers: 7,3,5,8,5,8,3,6,7,3,6,7,8,5,3 Slip - 10 83. Given the following grammar for expressions, write LEX and YACC script to generate a parser that will evaluate a valid expression. E -> E + E | E E | E * E | E / E | E ^ E | (E) | Num Where ^ has the highest precedence and a^b is a raised to b and other operators have usual precedence. Num is an integer. 84. Write a program that behaves like a shell (command interpreter). It has its own prompt say myshell$. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. 85. search f <pattern> <filename> - search first occurrence of pattern in filename 86. search c <pattern> <filename> - count no. of occurrences of pattern in filename 87. search a <pattern> <filename> - search all occurrences of pattern in filename Slip - 11 88. Write a SMAC0 CPU simulator program in C for the following instruction set Mnemonic Opcode Meaning READ 01 Read into memory operand PRINT 02 Print contents of memory operand STOP 03 Stop of halt execution ADD 04 Add memory operand to register operand

SUB 05 Subtract memory operand to register operand MOVER 06 Move memory operand contents to register MOVEM 07 Move register contents to memory operand MULT 08 Multiply memory operand to register operand DIV 09 Divide memory operand to register operand BC 10 Branch to 2nd operator depending on condition code specified as 1 st operand. COMP 11 Compare register & memory operand to set appropriate condition Code Assemble following program manually and execute it using above simulator. READ N LOOP MOVER AREG, SUM ADD AREG, N MOVE M AREG, SUM MOVER AREG, N SUB AREG, ONE COMP AREG, ZERO BC LE, OUT MOVEM AREG, N BC ANY, LOOP OUT PRINT SUM STOP N DS 1 ZERO DC 0 ONE DC 1 SUM DC 0 END 89. Write the simulation program for preemptive scheduling algorithm using Round Robin with time quantum of 2 units. The arrival time and first CPU bursts of different jobs should be input to the system. Assume the fixed I/O waiting time (2 units). The next CPU burst should be generated using random function. The output should give the Gantt Chart, Turnaround Time and Waiting time for each process and average times. Slip - 12 90. Write a SMAC0 CPU simulator program in C for the following instruction set Mnemonic Opcode Meaning STOP 01 Stop of halt execution SUB 02 Subtract memory operand to register operand ADD 03 Add memory operand to register operand DIV 04 Divide memory operand to register operand MULT 05 Multiply memory operand to register operand PRINT 06 Print contents of memory operand READ 07 Read into memory operand MOVEM 08 Move register operand contents to memory MOVER 09 Move memory operand contents to register BC 10 Branch to 2nd operator depending on condition code specified as 1 st operand. COMP 11 Compare register & memory operand to set appropriate condition Code. Assemble following program manually and execute it using above simulator. READ N LOOP MOVER AREG, N

MULT AREG, I MOVEM AREG, RES PRINT RES MOVEM AREG, I ADD AREG, ONE COMP AREG, TEN BC GE, HALT MOVEM AREG, I BC ANY, LOOP HALT STOP N DS 1 RES DS 1 I DC 1 TEN DC 10 ONE DC 1 END 91. Write the simulation program for demand paging and show the page scheduling and total number of page faults according to LRU page replacement algorithm. Assume the memory of n frames. Request Page Numbers: 5,8,10,14,10,9,5,10,8,5,11,10,9,5,10 Slip - 13 92. Given the following grammar, remove conflicts, if any. Write LEX and YACC script to generate a parser that will print valid is case a valid statement in the language is given as input. S-> REPEAT stat UNTIL cond ENDREP stat-> stat stat | ID = NUM; | NUM = ID; cond-> idnum relop idnum idnum -> ID | NUM relop -> < | > | = = where ID is identifier which starts with letter and remaining characters can be numbers or letters only. NUM is an integer number. 93. Consider a system with n processes and m resource types. Accept number of instances for every resource type. For each process accept the allocation and maximum requirement matrices. Write a program to check if the given request of a process can be granted immediately or not. Slip - 14 94. Write a program to accept a SMAC0 program written in mnemonics. After reading the entire program, print the following errors wherever applicable 95. symbols used but not defined 96. symbols defined but not used 97. redeclaration of symbols Consider the following example as sample input START 100 READ A MOVER AREG, A ADD AREG, A A MOVEM AREG, C STOP A DS 1 B DS 1 END 98. Write the simulation program for preemptive scheduling algorithm using Priority. The arrival

time, first CPU bursts and process priority of different jobs should be input to the system. Assume the fixed I/O waiting time (2 units). The next CPU burst should be generated using random function. The output should give the Gantt chart, Turnaround Time and Waiting time for each process and average times. Slip - 15 99. Write a program to accept a SMAC0 program written in mnemonics. After reading the entire program, print the following errors wherever applicable in the program. 100.invalid statement 101.invalid mnemonic Consider the following example as sample input START 100, 2 READ A MOVER A, AREG BAD AREG, A STOP A DS ONE END 102.Consider a system with n processes and m resource types. Accept number of instances for every resource type. For each process accept the allocation and maximum requirement matrices. Write a program to check if the given request of a process can be granted immediately or not. Slip - 16 103.Write a command line program for line editor. The file to be edited is taken as command line argument; an empty file is opened for editing if no argument is supplied. It should display $ prompt to accept the line editing commands. Implement the following commands. 104.a - to append 105.h - to give help information about all commands 106.d m n - to delete range of lines 107.s - to save 108.Write the simulation program for demand paging and show the page scheduling and total number of page faults according to SECOND CHANCE page replacement algorithm. Assume the memory of n frames. Request Page Numbers: 9,14,10, 11, 15, 9, 11, 9, 15, 10, 9, 15, 10, 12, 15 Slip - 17 109.Write a SMAC0 CPU simulator program in C for the following instruction set Mnemonic Opcode Meaning MOVER 01 Move memory operand contents to register MOVEM 02 Move register contents to memory operand READ 03 Read into memory operand PRINT 04 Print contents of memory operand COMP 05 Compare register & memory operand to set appropriate condition Code. BC 06 Branch to 2nd operator depending on condition code specified as 1 st operand. MULT 07 Multiply memory operand to register operand DIV 08 Divide memory operand to register operand ADD 09 Add memory operand to register operand SUB 10 Subtract memory operand to register operand STOP 00 Stop of halt execution Assemble following program manually and execute it using above simulator. READ A

READ B MOVER AREG, A COMP AREG, B BC GT, MAX1 MOVER AREG, B MOVEM AREG, MAX OUT PRINT MAX BC ANY, HALT MAX1 MOVEM AREG, MAX BC ANY, OUT HALT STOP MAX DS 1 A DS 1 B DS 1 END 110.Write a program that behaves like a shell (command interpreter). It has its own prompt say myshell$. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. i. count c <filename> - print number of characters in file ii. count w <filename> - print number of words in file iii. count l <filename> - print number of lines in file Slip - 18 111.Write a program to accept a SMAC0 program written in mnemonics. After reading the entire program, print the following errors wherever applicable iv. symbols used but not defined v. symbols defined but not used vi. redeclaration of symbols Consider the following example as sample input START 100 READ X Y MOVER BREG, X ADD BREG, X X MOVEM AREG, Z STOP X DS 1 Y DS 1 END 112.Write the simulation program for non-preemptive scheduling algorithm using Priority. The arrival time, first CPU bursts and process priority of different jobs should be input to the system. Assume the fixed I/O waiting time (2 units). The next CPU burst should be generated using random function. The output should give the Gantt chart, Turnaround Time and Waiting time for each process and average times. Slip - 19 113.Write a MACRO PREPROCESSOR for SMAC0, which reads a macro definition & main program in which macro is called. Define a macro with any number of positional and keyword parameters. Your program should display MNT (Macro Name Table), MDT (Macro Definition Table) and KPT (Keyword Parameter Table) only. 114.Write the simulation program for demand paging and show the page scheduling and total number of page faults according to FIFO page replacement algorithm. Assume the memory of n frames.

Request Page Numbers: 9,14,10, 11, 15, 9, 11, 9, 15, 10, 9, 15, 10, 12, 15 Slip - 20 115.Write a MACRO PREPROCESSOR for SMAC0, which reads a macro definition & main program in which macro is called. Your program should display SMAC0 program with expanded macro. Consider only positional parameters. INPUT OUTPUT MACRO SOLVE &X, &Y READ A MOVER AREG, &X READ B MULT AREG, &Y MOVER AREG, A SUB AREG, &Y MULT AREG, B MOVEM AREG, &X SUB AREG, B MEND MOVEM AREG, A READ A PRINT A READ B STOP SOLVE A, B A DS 1 PRINT A B DS 1 STOP A DS 1 B DS 1 116.Write a simulation program for disk scheduling using SCAN algorithm. Accept total number of disk blocks, disk request string, direction of head moment and current head position from the user. Display the list of request in the order in which it is served. Also display the total number of head moments.

Server Databases and Application Development


Slip - 1 117.Consider the following entities and their relationships Doctor (doc_no, doc_name, address, city, area) Hospital (hosp_no, hosp_name, hosp_city) Doctor and Hospital are related with many-many relationship Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql a. Write a script to list the names of doctors who visit every hospital located in the city where they do not live. b. Write a script cursors to print the list showing the doctor wise list of hospitals. 118.Using above database, write a PHP script which accepts hospital name and print information about doctors visiting / working in that hospital in tabular format. Slip - 2 119.Consider the following entities and their relationships Movie (movie_no, movie_name, release_year) Actor (actor_no, name) Relationship between movie and actor is many many with attribute rate in Rs. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 120.Write a script for the following List the actor name and movie name in which actors rate is greater than 2 lakhs. 121.Define a trigger before insert or update of each row of movie, that movies released after 2000 be entered into the movie table. 122.Using above database, write a PHP script which a. accepts actor name and display all movie names in which he has acted, b. accept movie name and list all actors in that movie Slip - 3 123.Consider the following entities and their relationships Item (item_no, Item_name, qty) Supplier(supp_no, supp_name, address, city, phoneno) Item and Supplier are related with manymany relationship with rate and discount as the attribute of relationships. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql a. Define a trigger before updation on discount field, if the difference in the old discount and new discount be is entered is greater than 5% raise an exception and display corresponding message. b. Write a script to list the suppliers who live in same city but supply different set of items. 124.Using above database, write a PHP script, Create a login form, after validating user name and password give option to 1) Add item 2) Search for an item by name Slip - 4 125.Consider the following entities and their relationships Emp (emp_no, emp_name, sex, phoneno, address, joiningdate, desg, salary) Dept (deptno, deptname, location) Emp and Dept Are related with manyone relationship Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql a. Write a script to list the names of all employees who are men and are earning maximum salary in their department. b. Write a script to give raise in salary by 5% for all the employees earning less than 5000 and 9% for all employees earning more than or equal to 5000. Also print the total numbers of employees in each case. 126.Write a PHP. Create a flat file of student information - Studentno, name, mark1, mark2 ,

mark3. Read this file and print the marklist in tabular form. Marklist will contain Studentno, name mark1, mark2 , mark3 and percent for all the students. (Minimum 5 student records should be added). Slip - 5 127.Consider the following entities and their relationships Emp(emp_no, Emp_name, Salary, Comm) Dept(dept_no, dept_name, Location) Employee and dept are related with One_Many relationship, Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 128.Write a script to transfer all employees of dept. C of location CB earning the commission of 50% of their salary to dept B. Also print the total number of employees of dept C transferred to dept B. 129.Write the script for the following: Give the names of all those locations which has total of at least 5 depts. in it. Out of which at least 3 depts are spending approximate Rs. 50000/- as salary of the employee. 130.Write a PHP script to Accept the Dir name and print the contents of that dir. Slip - 6 131.Consider the following entities and their relationships Emp(emp_no, Emp_name, Salary, Comm) Dept(dept_no, dept_name, Location) Employee and dept are related with One_Many relationship, Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 132.Write a script to transfer all employees of dept. C of location CB earning the commission of 50% of their salary to dept B. Also print the total number of employees of dept C transferred to dept B. 133.Write the script for the following: Give the names of all those locations which has total of at least 5 depts. in it. Out of which at least 3 depts are spending approximate Rs. 50000/- as salary of the employee. 134.Write a PHP script to create a form that accept the users full name and their email addresses. Use case conversion function to capitalize the first letter of each name, user submits and print result back to browser. Check that the users email address contains the @ symbol. Slip - 7 135.Consider the following entities and their relationships Company(c_no, c_name, c_addr, c_city, c_share_value) Person(p_no, P_name, P_addr, P_city, P_phone_no,) Company and person are related with many-many relationship with a number of shares as an attribute to relationship. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 136.Write a trigger which will activated when company tuple is updated. It should delete all the related tuples when share value of company becomes < Rs. 10/137.Write a procedure/function which will take company name as a parameter and will find names of persons who are share holders of the company. 138.Write PHP script : to create xstring.inc file to include int=xstrstr($s1,$s2) search first occurrence of $1 in $2. Int = xstr_rev($s, $n) n is the position and s is the string. Reverse S from position n (Without using built in functions) Slip - 8 139.Consider the following entities and their relationships company(c_no, c_name, c_addr, c_city, c_share_value) Person(p_no, P_name, P_addr, P_city, P_phone_no,) Company and person are related with many_many relationship with a number of shares as a

attribute to relationship. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 140.Write a trigger which will activated when company tuple is updated. It should delete all the related tuples when share value of company becomes < Rs. 10/141.Write a procedure/function which will take company name as a parameter and will find names of persons who are share holders of the company. 142.Write a PHP script to create xstring.inc file to include int = xstrcat($S1,$S2) int = x_replace($S1, $S2, position) Replace $S1 with $S2 from position (Without using built in functions ) Slip - 9 143.Consider the following entities and their relationship. Book( book_no, book_name, price) Publisher (p_no, p_name, p_addr) Book and Publisher are related with many-many relationship Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 144.Write a script which will update the book details of book_no entered by user. Raise exception if the given book number is not present or if the price of the book is greater than 5000. 145.Write a script which will take publisher name as parameter and will display books published by the publisher. 146.Write a PHP script for the following Create a login form with username and password, using http authentication. Once the user logs in the 2nd form should be displayed to accept user details (name, city, phoneno). Display the accepted user details on the next form. Slip - 10 147.Consider the following entities and their relationships. Employee (Emp_no, Emp_name, Basic_sal) Dept (Dept_no, Dept_name) Employee and Dept are related with manyone relationship. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 148.Write a script to calculate the salary of each employee as follows HRA Rs 2000 if basic_sal <=Rs 8000 Rs 2500 otherwise DA 35% of Basic_sal CA Rs 500 if Basic_sal < Rs 6000 Rs 800 if basic_sal > Rs 6000 and <=Rs 9000 Rs 1200 otherwise PF- 11% of Basic_sal PT Rs 200 if basic_sal <= Rs 8000 Rs 250 otherwise. NetSalary is calculated as basic_sal+HRA+DA+CA-PF-PT 149.Write a script using parameterized cursor to print department wise list of employees. Pass dept_no as parameter to cursor. 150.Using above database write a PHP script for the following to display the employees earning salary greater than user define salary. (accept salary from user). Slip - 11 151.Consider the following entities and their relationships. Item (item_no, item_name, qty, rate, min_stock) Sale (tr_no, date, amount, sale-qty) Item and Sale are related with one-many relationship.

Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 152.The transactions are processed in batch. At the end of the day the quantity file is updated depending on the sale on that day. Write a script to update the qty-on-hand depending on sale on that day. 153.Write a trigger which will execute when sale transaction is added, in case the qty-onhand is less than min-stock. 154.Write a PHP script to accept user preference like background colour, text font, login message. On the next page display login message using the preferences. Slip - 12 155.Consider the following entities and their relationships. Customer (cust_no, name, address, city) Account(acc_no, acctype, balance) Actype can be saving, fixed, joint Transaction (tran_no, tran_type, date , amount) Relationship between customer and account is many-many. And between account and transaction is one-many. Transaction type can be w for withdrawal or d for deposit. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 156.Write a script for the following for a particular customer for each of account held by his list its transaction details. 157.Define a trigger to take care of the following constraint: The balance amt in an account should always be >= 500. 158.Write a PHP script that enables the user to construct his own web form with the capabilities to choose control & then allow the user to submit the form & display the selected controls on next page. Slip - 13 159.Consider the following entities & relationships Movie(movie-no, name, release-year) Actor(actor-no, name) Relation between movie & actor is many-to-many. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 160.Write a script for the following Accept the name of an actor from the user & for the specified actor list the details of all the movies the actor has acted in. 161.Define a trigger that will take care of the constraint that movies released after 1990 be entered in the movie table. 162.Write a PHP script, which accepts customer info (name,address, phone number) on the first form. Once accepted, on the 2nd form accept sale transaction details like code, name, qty , rate per unit, for five items. Display the bill in tabular format in the next form. (Use of arrays & cookies required). Slip - 14 163.Consider the following entities & relationships Book(book-no,name,price) Dept(dept-no,name) Publisher(pub-no,name) Relation between book & department is many-to-one. Between book & publisher is manyto-one. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 164.Write a script for the following List the names of publishers who have published atleast 3 books whose prices are > 100 respectively for a department named computer science. 165.Write a script for the following Update the price of book based on following

For books belonging to department 5 , & price < 100 , increase price by 20% For books published by ABC publications & not belonging to department 5 increase price by 10%. 166.Write a PHP script for the following Accept a string from the user . provide 3 options : replace , search & concat. (radio buttons). Also provide 2 text boxes. In case replace is selected, provide the replace string & string to be replaced with. For search , provide the search string in one box. For concat, same as search. (use built-in string functions) Slip - 15 167.Consider the following entities & relationships doctor(doctor-no, name, city, birth-date) hospital(hospital-no,name, city) doctor & hospital are related with many-to-many relationship. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 168.Write a script for the following: List the names of doctors who visit every hospital located in the city where they live. 169.Define a trigger that will take care of the constraint a doctors age should be greater than 25. 170.Write a PHP script for the following Accept area-wise donation information (state name, area (north, south, east, west), donation amount). Print area-wise donation % for each area (use of arrays or classes required). Slip - 16 171.Consider the following entities & relationships Route-header(routeid, origin, distance ) Destination (dest-id, name, fare) Relation between the route-header & destination is many-to-one. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 172.Write a script for the following Accept route-id as user input. If the distance is less than 500 , then update the fare to that destination to 190.98. If distance is between 501 1000 , update the fare to that destination to 876.89 If the distance is > 1000, display a message. 173.Accept destination name from user & print different routes to it along with distance 174.Write a PHP script for the following Create a form called shape (rectangle/square/circle) display the area of the selected shape (use the concept of classes & inheritance) Slip - 17 175.Consider the following entities & relationships room(room-no, fare, type) guest(guest-no, address, check-in-date, no-of-days, no-of-persons) Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 176.Write a script for the following Increase the fare of AC rooms by 70% & Non-AC rooms by 25%. 177.Define a trigger to check that a room when being allocated is a free room (i.e. not allocated to anybody. Consider the check-in-date & number-of-days of stay) 178.Write a PHP script for the following Accept a string from the user & check whether its a palindrome (implement stack operations using array built-in functions) . Slip - 18 179.Consider the following entities & relationships donor(donor-no, name, city)

blood(blood-id, bloodgroup, quantity , Rhfactor, date-of-collection) Relation between the blood & donor is many-to-one. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 180.Define a trigger which will maintain a total-blood table containing the bloodgroup , rhfactor , total quantity. Trigger should be fired whenever the blood table is modified. 181.Write a script to print donor-wise list of blood donated alongwith date of donation. 182.Write a PHP script for the following Display a reference page of information about an objects properties, methods & inheritance tree (for each class declared)Define your own classes as required. (One level of inheritance sufficient) Slip - 19 183.Consider the following entities & relationships Game(name, no-of-players, coachname) Players(name, address, clubname) Relation between game & player is many-to-many. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 184.Write a script for the following List all the games which require more than 4 players & all those players who also play more than 3 games. 185.Write a script to accept a game name & list the names of players playing that game. 186.Write a PHP script for the following Create a form to accept customer info (name, address, phone number). Once the customer info is accepted, accept product info in next form (product name, quantity, rate). Display the bill for the customer in the next form. Bill should contain the customer information & the info of the products entered. (Use of sessions required) Slip - 20 187.Consider the following entities & relationships Client(client-no, name, address, birth-date) Policy-info(policy-no, description, maturity amount, premium amt, policy-intro-date ) Relation between the client & policy-info is many-to-many with date-of-purchase as the descriptive attribute to the relation. Create a RDB in 3 NF for the above and solve following queries in Oracle / Postgresql 188.Write a script for the following Display customer wise list of policies taken (all information about the policy should be displayed) 189.Define a trigger to check the constraint that the date-of-purchase should be greater than the policy-intro-date, whenever a policy is sold to a client. 190.Write a PHP script for creating a self-processing page for a form. The form should allow the user to enter the following attributes: Username, user city preference(pune/Mumbai/Chennai/kolkata),user birth date, occupation, sex. If any of the values is not entered by the user, the page is presented again with a message specifying the attributes that are empty. Any form attributes that the user already entered, are set to the values the user entered. The text of submit button changes from create to continue, when the user is correcting the form. Display the details entered by the user on the next form.

Java Programming
Slip 1 191.Write a JAVA program for following screen: 192.Using Collections implement Hash table to a. Accept n records of students (Name, Percentage) b. Display details of all students c. Find out highest marks Slip 2 193.Design a screen in Java as shown in following figure: Button (<<) moves all items from List1 to List2. Button (<) moves single item from List1 to List2. Other 2 buttons does the same but from list2 to list1. When 1 item is moved, the next item should be highlighted automatically. No list box should contain duplicate entries. Add and Remove button should work for their own list box and not for the other. 194.Write a java program to create a class called FileWatcher that can be given several filenames that may or may not exist. The class should start a thread for each file name. Each thread will periodically check for the existence of its file. If the file exists, the thread will write a message to the console and then end. Slip 3 195.Write a Java program to create 2 files F1 and F2.Copy the contents of file F1 by changing the case into file F2. F2 = F1 Also copy the contents of F1 and F2 in F3. F3 = F1+F2 Display the contents of F3. Use Command Line Arguments. 196.Write a program to create a shopping mall. User must be allowed to do purchase from two pages. Each page should have a page total. The third page should display a bill, which consists of a page total of what ever the purchase has been done and print the total. (Use http session tracking) Slip 4 197.Enter decimal number in the text field. When Calculate will be clicked display binary, octal, hexadecimal equivalents. (Dont use standard library functions)

198.Using Collections implement Linked List for following options:


199.Accept 2 singly linked list for character data 200.Perform

a. Union (ascending order) b. Intersection (ascending order) c. Concatenation of corresponding elements 201.Display all the options till Exit is not selected. Slip 5 202.A class ExceptionDemo throws the following exception depending upon the following condition: Take any integer from keyboard 203.if the integer is between 0 to 5, the exception of type Small Number is thrown. 204.If the number is between 5 to 10, Proper Number is thrown. 205.If the number is greater than 10, Greater Number is thrown. Also find factorial of that number. (Use static keyword) 206.Design a menu driven system, which will perform following options for student data (Roll No. Name, Per) Insert, Update, Search Delete Record. Raise appropriate exceptions if wrong data are entered like no ve for roll and per. Slip 6 207.Write a Java program to design a screen using swings that will create four text fields. First for the text, second for what to find and third for replace. Display result in the fourth text field. Also display the count of total no. of replacements made. The button clear to clear the text boxes.

208.Write a program to create an applet that contains a text box, a start button and on/off button. On clicking start button, one should display the integers continuously in the text box incremented. On click on/off button should stop the incrementing and again a click on on/off button should resume the execution. Slip 7 209.Write a Java program to accept list of files as command line arguments. Display the name and size of all the files. Delete all files with extension as .html from the current directory. Appropriate error messages should be printed. 210.Design an HTML page containing 4 option buttons (Painting, Drawing, Singing and swimming) and 2 buttons reset and submit. When the user clicks submit, the server responds by adding cookie containing the selected hobby and sends the HTML page to the client .Program should not allow duplicate cookies to be written. Slip 8 211.Write a class Student with attributes roll no, name, age and course. Initialize values through parameterized constructor. If age of student is not in between 15 and 21 then generate userdefined exception Age Not Within The Range.If name contains numbers or special symbols raise exception Name not valid.

212.Write a pgm in Java to Read ,Update and Delete any record from database. The database will be created in appropriate backend. Database about Element (Oxygen, Hydrogen) has following fields (Atomic weight, Name, Chemical symbol) The input should be provided through Command Line Argument along with the appropriate data. Ex. Java Pgm_name R Will read and show the contents of the table. Ex. Java Pgm_name U 10 Oxygen 137 Will update the record according to the name specified. (JDBC) Slip 9 213.Create a package TYBSc which will have 2 classes as class Mathematics with a methods to add two numbers, add three float numbers and class Maximum with a method to find maximum of three numbers. (Make use of finalize) 214.Design a menu driven system, which will perform following options for student data (Roll No. Name, Per) Insert, Update, Search Delete Record. Raise appropriate exceptions if wrong data are entered like no ve for roll and per. Slip 10 215.Write a package for Games, which have two classes Indoor and Outdoor. Use a function display () to generate the list of players for the specific games. Use default and parameterized constructors. Make use of protected access specifier. Also use finalize () method. 216.Write a java program to create a class called FileWatcher that can be given several filenames that may or may not exist. The class should start a thread for each file name. Each thread will periodically check for the existence of its file. If the file exist, the thread will write a message to the console and then end. Slip 11 217.Create an abstract class Shape. Derive three classes sphere, cone and cylinder from it. Calculate area and volume of all. (Use Method overriding) 218.Write a program to create a screen that contains a text box, a start button and on/off button. On click on start button one should display the integers continuously in the text box incremented. On clicking on/off button, it should stop the incrementing and again a click on on/off button should resume the execution. Slip 12 219.Write a Java program to accept a number from the user and print it in words. (Max no.99999) Ex. I/P: 10511 O/P: Ten Thousand Five Hundred and Eleven 220.Write a program in Java to Read, Update and Delete any record from database. The database will be created in appropriate backend. Database about Element (Oxygen, Hydrogen) has following fields (Atomic weight, Name, Chemical symbol). The input should be provided through Command Line Argument along with the appropriate data. Ex. 1. Java Pgm_name R Will read and show the contents of the table. Ex. 2. Java Pgm_name U 10 Oxygen 137 Will update the record according to the name specified. Slip 13 221.Design a screen in Java to handle the mouse events and display the positions of the mouse click in a text box. 222.Design a menu driven program in Java, which will perform following options for student

data (Roll No. Name, Per) Insert, Update, Search Delete Record. Raise appropriate exceptions if wrong data are entered like no ve for roll and per. Slip 14 223.Write a Java program to design a screen using swings that will take a user name and password. If the user name and password are not same, raise an exception with appropriate message. User can have 3 login chances only. Use clear button to clear the text boxes.

224.Write a java program to create a class called FileWatcher that can be given several filenames
that may or may not exist. The class should start a thread for each file name. Each thread will periodically check for the existence of its file. If the file exists, the thread will write a message to the console and then end. Slip 15 225.Write a Java program to accept the details of cricket player (Name, Total runs, Not outs, Innings Played) store it in an array. Write a function to calculate the averages of all. Also write a function to sort the array on the basis of average and show the output as a sorted array. 226.Design an HTML page containing 4 option buttons (Painting, Drawing, Singing and swimming) and 2 buttons reset and submit. When the user clicks submit, the server responds by adding cookie containing the selected hobby and sends the HTML page to the client. Program should not allow duplicate cookies to be written. Slip 16 227.Design a screen in Java that will implement a special purpose calculator, which calculates only square roots. A screen should contain 2 text boxes, one for input and other for output. A screen should also contain 2 buttons namely calculate to see the result and clear to clear the text boxes.

. 228.Design a menu driven system, which will perform following options for telephone data (Tel No., Name, Address) Insert, Update, Search Delete Record. Raise appropriate exceptions if wrong data are entered like no ve for telephone no.

Slip 17 229.Create an application in Java using Swings to display 4 X 4 squares on the screen. One of the block will be active with black color. All other blocks should be filled with blue color. Provide command buttons as follows to move the active cell. The active cell should be changed only if it is within the boundary of the squares otherwise give the beep.

230.Design a servlet that provides information about a HTTP request from a client, such as IP
address and browser type. The servlet also provides information about the server on which the servlet is running, such as the operating system type, and the names of currently loaded servlets. Slip 18 231.Write a Java program to simulate the arithmetic calculator (+ ,- ,* , /).Also add 2 buttons namely on to start the calculator and clear to clear the text box. Display appropriate error message in the text box.

232.Write a program in Java, which will show lifecycle (creation, sleep, dead) of a thread.
Program should print randomly the name of the thread and value of sleep time. The name of the thread should be hard coded through constructor .The sleep time of a thread will be a random integer in the range 0 to 4999. Slip 19 233.Write a Java program that acts as a table tester. The program should generate 2 random numbers, one between 1 to 10, and other between 1 to 100. Display the numbers on screen. Accept another number from user. This number should be the product of 2 previously generated numbers .If the entered number is a proper product then adds it to the score. Display the final score on Exit.

234.Write a java program create a database to represent an employee (code, name, designation). Design two derived classes emp_account (accounting number, joining date) and emp_sal

(basic + pay + earnings-deduction). Write a menu driven program to - Build a master table - Sort all entries - Display (Use array of objects) Slip 20 235.Using Swings design a Binary Calculator that has the operations addition, subtraction and complement. The operations will be provided using menus. 236.Design a screen using swings to store the details of a telephone user. User has the following attributes: User (code, telephone number, number of calls). Write necessary function to accept details and store it in database. Also write necessary function that calculates the bill and displays the bill using the following rule. Category: Urban Area (the first 100 calls are free and rent is Rs. 700) No. Of Calls Charge (per call) > 100 and <=500 Rs. 1.30 > 500 Rs. 1.70 Category: Rural Area (the first 300 calls are free and rent is Rs. 400) No. Of Calls Charge (per call) > 300 and <=500 Rs. 0.80 > 500 Rs. 1.00 Write a function to search the user record according to the Telephone Number.

You might also like