406P S.V.U.COLLEGE OF COMMERECE MANAGEMENT & INFORMATION SCIENCES. TIRUPATI Department of Computer Science M.C.A IV SEMESTER 2007 - 2008 Software Labaratory - IV PPL & E-Commerce Lab Programs List 1. Command Line Arguments Concept a. C b. Java 2. Recursion a. Direct b. Indirect 3. Object Creation And Destruction a. Constructors & Destructors In C++ b. Constructors & Garbage Collector Invocation In Java. 4. Memory Allocation a. Static Allocation b. Dynamic Allocation 5. Bindings a. Static Binding (Method Overloading) b. Dynamic Binding (Method Overriding) 6. Parameter Passing Schemes a. Pass by Value b. Pass by Address c. Pass by Reference 7. A Simple Scanner & Parser Development 8. Function Pointers 9. Sharing your own code a. Header files in C++ b. Package creating in java c. Package creating in oracle 10. Access Specifies Concept a. C++ b. Java 11. Exception Handling Mechanism a. C++ b. Java c. Oracle 407P WEB PROGRAMMING LAB 1. A local university has asked you to create an XHTML document that allows prospective students to provide feedback about their campus visit. Your XHTML document should contain a form with text boxes for name, address, and email. Provide checkboxes that allow prospective students to indicate what they liked most about the campus. The checkboxes should include: students, location, campus, atmosphere, dorm rooms and sports. Also, provide radio buttons that ask the prospective students how they became interested in the university. Options should include: friends, television, Internet and other. In addition, provide a text area for additional comments, a submit button and a reset button. 2. a). Write a script that reads five integers and determines and outputs XHTML text that displays the largest and smallest integers in the group. Use only the programming techniques you learned in this chapter. b). Write a script that reads an integer and determines and outputs XHTML text that displays whether it is odd or even. [Hint: Use remainder operator. An even number is a multiple of 2. Any multiple of 2 leaves a remainder of zero when divided by 2.] c). Write a script that reads in two integers and determines and outputs XHTML text that displays whether the first is a multiple of the second. [Hint: Use the remainder operator.] d). Using only the programming techniques you learned in this chapter, write a script that calculates the squares and cubes of the numbers from 0 to 10 and outputs XHTML text that displays the resulting values in an XHTML table format, as follows: Number square cube 0 0 1 1 1 1 2 4 8 3 9 27 4 16 64 5 25 125 6 36 216 7 49 343 8 64 512 9 81 729 10 100 1000 [Note: This program does not require any input from the user.] 3. Write JavaScript statements to accomplish each of the following tasks: a). Assign the sum of x and y to z, and increment the value of x by 1 after the calculation. Use only one statement. b). Test whether the value of the variable count is greater than 10. If it is , print “Count is greater than 10”. c). Decrement the variable x by 1, then subtract is from the variable total, Use only one statement. d). Calculate the remainder after q is divided by divisor, and assign the result to q. Write this statement in two different ways. 4. One of the most popular games of chance is a dice game known as craps, which is played in casinos and back alleys throughout the world. The rules of the game are straightforward: A player rolls two dice. Each die has six faces. These faces contain one, two, three, four, five and six spots, respectively. After the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum is 2, 3 or 12 on the first throw (called “craps”), the player loses (i.e., the “house” wins). If the sum is 4, 5, 6, 8, 9 or 10 on the first throw, that sum becomes the player’s “point.” To win, you must continue rolling the dice until you “make your point” (i.e., roll your point value). The player loses by rolling a 7 before making the point. 5. An integer number is said to be a perfect number if its factors, including 1 (but not number and itself), sum to the number. For example, 6 is perfect number, because 6=1+2+3. Write a function perfect that determines whether parameter number is a perfect number. Use this function in a script that determines and displays all the perfect numbers between 1 and 1000. Print the factors of each perfect number to confirm that the number is indeed perfect. Challenge the computing power of your computer by testing numbers much larger than 1000. Display the results in a <textarea>. 6. An integer is said to be prime if it is greater than 1 and divisible only by 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not. a). Write a function that determines whether a number is prime. b). Use this function in a script that determines and prints all the prime numbers between 1 and 10,000. How many of these 10,000 numbers do you really have to test before being sure that you have found all the primes? Display the results in a <textarea>. c). Initially, you might think that n/2 is the upper limit for which you must test to see whether a number is prime, but you only need go as high as the square root of n. Why? Rewrite the program, and run it both ways. Estimate the performance improvement. 7. Write a JavaScript for searching an array with linear search and binary search. 8. Write a JavaScript for a). Matrix multiplication b). Matrix addition c). Transpose of a matrix. 9. Write a script that inputs several lines of text and a search character and uses string method index of to determine the number of occurrences of the character in the text. 10. a). Use a screen object to get the size of the user’s screen, then use this information to place an image(using dynamic positioning) in the middle of the page. Note: This exercise assumes that the user’s browser window is maximized to the full width of the screen. b). Write a script that loops through the elements in a page and places enclosing <strong>……</strong> tags around all the text inside all the p elements. c). Write a script that prints out the length of all the JavaScript collections on a page. 11. a). Write an error handler that changes the alt text of an image to “Error Loading” if the image loading is not completed. b). Write a function that responds to a click anywhere on the page by displaying an alert dialog. Display the event name if the user held Shift during the mouse click. Display the element name that triggered the event if the user held Ctrl during the mouse click. 12. a). Create a Web page that applies the invert filter to an image if the user moves the mouse over it. b). Create a Web page that applies the glow filter to a hyperlink if the user moves the mouse over the link. c). Write a script that blurs images and slowly unblurs them when they are finished loading into the browser (use event on load for the image). d). Write a script that creates a cone light filter that tracks mouse movements across the page. 13. a). Create a data source file with two columns: one for URLs and one for URL Descriptions. Bind the first column to an element on a page and the second to Span element contained within the element. b). Create a data source with a set of name/password pairs. Bind these fields to an Input type= “text” and input type= “password” and provide navigation buttons to allow the user to move throughout the data source. 14. a). Create an XML document that marks up the nutrition facts for a package of Grandma Deitel’s Cookies. A package of Grandma Deitel’s Cookies has a serving Size of 1 package and the following nutritional value per serving: 260 calories, 100 grams of fat, 2 grams of saturated fat, 5 milligrams of cholesterol, 210 milligrams of sodium, 36 grams of total carbohydrates, 2 grams of fiber. 15 grams of sugar and 5 grams of protein. Load the XML document in Internet Explorer 6. [Hint: Your markup should contain elements that describe the product name, serving size/amount, calories, sodium, cholesterol, protein, etc. Mark up each nutrition fact/ingredient listed above.] b).Write a schema that provides tags for a person’s first name, last name, weight And Shoe size, weight and shoe size tags should have attributes to designate Measuring systems. 15. Write SQL queries for the Books.mdb database that perform each of the following Tasks: a) Select all authors from the Authors table. b) Select all publishers from the Publishers table. c) Select a specific author and list all books for that author, Include the title, year and ISBN number. Order the information alphabetically by title. d) Select a specific publisher and list all books published by that publisher, Include the title, year and ISBN number. Order the information alphabetically by title. 16. Write SQL statements for the Books.mdb database that perform each of the Following tasks: a). Add a new author to the Authors table. b). Add a new title for an author (remember that the book must have an entry in The Author-ISBN table). Be sure to specify the publisher of the title. c). Add a new publisher. 17. Write a Perl program named ex25_07.pl that creates a scalar variable $states with The value “Mississippi Alabama Taxas Massachusetts Kansas”. Using only techniques discussed in this chapter, write a program that does the following: a). Search for a word in a scalar $states that ends in xas. Store this word in element 0 of an array named @statesArray. b). Search for a word in $states that begins with k and ends in s. Perform a caseInsensitive comparison. Store this word in element 1 of @statesArray. c). Search for a word in $states that begins with M and ends in s. Store this in element 2 of the array. d). Search for a word in $states that ends in a. Store this word in element 3 of the array. e). Search for a word in $states at the beginning of the string that starts with M. Store this word in element 4 of the array. f). Output the array @statesArray to the screen. 18. Write a PHP program that tests whether an e-mail address is input correctly. Verify That the input begins with series of characters, followed by the @ character, another series of characters, a period (.) and final series of characters. Test your program, using both valid and invalid e-mail addresses. 408P DATA WAREHOUSING LAB LIST Using Informatica 7.1 1) Design a mapping using Source Qualifier Transformation 2) Design a mapping using Filter Transformation 3) Design a mapping using Joiner Transformation 4) Design a mapping using Aggregator Transformation 5) Design a mapping using Sorter Transformation 6) Design a mapping using Router Transformation 7) Design a mapping using Union Transformation 8) Design a mapping using Transaction control Transformation 9) Design a mapping using Rank Transformation 10) Design a mapping using XML Source Qualifier Transformation 11) Design a mapping using Update Strategy Transformation 12) Design a mapping using Normalizer Transformation 13) Design a mapping using Expression Transformation 14) Design a mapping using Sequence Generator Transformation 15) Design a mapping using stored procedure Transformation 16) Design a mapping using Lookup Transformation 17) Design a mapping using Target Load Plan 18) Design a mapping using Constrain Based Load Ordering (CBL) 19) Design a mapping using Mapplet 20) Design a mapping using Session Parameter