DELHI PUBLIC SCHOOL, BAREILLY XI- Computer Science (Worksheet-III) 1. WAP that checks whether the given character is alphanumeric or a digit (use library functions) 2. WAP that checks whether the given character is an alphabet or not. If it is an alphabet, whether it is a lowercase character or uppercase character. 3. WAP that converts lowercase letters in a given string to corresponding uppercase letters, and vice versa. 4. WAP that reads a string and converts it to uppercase. 5. WAP that reads 2 strings and appends the first string to the second. 6. WAP that reads a password and prints “OK” if the correct password is entered otherwise print “SORRY!”. The user should be given 3 chances to guess the password. 7. WAP to obtain a Random Number between 0-100 and let the user to guess it. Provide 3 chances to guess the number with proper messages. 8. Write a UDF named square ( ) which accepts a number as an argument and returns the square of the passed argument. 9. Write a UDF named cube ( ) which accepts a number as an argument and returns the cube of the passed argument. 10. Write a UDF named calculate ( ) which accepts 2 numbers & an arithmetic operator (+, - , *, /) as an argument and returns the result of calculation based on operator passed. 11. Write a UDF named fact ( ) which takes a number as an argument and returns the factorial of the passed number. 12. Write a UDF named power ( ) which takes 2 numbers as an argument and returns a double value. 13. Write a UDF named SumOfDigits ( ) which accepts a number as an argument and returns the sum of digits of that number. 14. Write a UDF named ValidDate ( ) which accepts a date as an argument and returns a value 1 or 0 depending on status of date. 15. WAP to accept percentage of 10 students in an Array and Find the class average. 16. WAP to accept 10 numbers in an Array and Find the Greatest number. 17. WAP to accept 10 numbers in an Array and Find the Lowest number. 18. WAP to accept 10 numbers in an Array and calculate the square of each number. 19. WAP to accept 10 numbers in an Array and calculate the sum of Even numbers & Odd numbers. 20. WAP to accept marks in 5 subjects of a student and calculate Percentage and Grade. 21. WAP to accept a line of string and calculate its length without using a library function. 22. WAP to accept a line of string and count the number of vowels in it. 23. WAP to accept a line of string and display its reverse. 24. WAP to accept a string and check it is a Palindrome or not. 25. WAP to accept a line of string and convert it into Proper Case. 26. WAP to accept marks of 3 students in 5 subjects and calculate Total, Percentage and Grade. 27. WAP to accept sales of 5 salesman in 3 products. Now calculate each salesman‟s total Sales and each product sales also. 28. WAP to accept a 3x3 matrix & display the sum of Rows. 29. WAP to accept a 3x3 matrix & display the sum of Columns. 30. WAP to accept a 3x3 matrix & display the sum of Diagonals. 31. WAP to accept a 3x3 matrix & display its Transpose. 32. Write a UDF named Transfer ( ) which should transfer the contents from one array named All [] to 2 different arrays named Odd [] & Even []. The Odd [] array should contain the values from odd positions and The Even [] array should contain the values from Even positions of the array. 33. WAP to define a structure which can store a student record (like rollno, name, class & marks in 5 subjects ). It should also calculate Total, Percentage and grade. 34. WAP to define a structure named „employee‟ having details like empID, name, basic salary, HRA, DA, & Net Salary. (Here, HRA=12% of basic salary, DA=44% of basic salary, Net Salary= basic salary + HRA+ DA ). Test it by accepting details of 5 employees. 35. WAP to define a structure to represent „Time‟. Now define a UDF named AddTime ( ) which should accept 2 arguments of „Time‟ type and return the addition of both Time‟s.
XI CS- WORKSHEET 3.pdf
WAP to accept a 3x3 matrix & display the sum of Rows. 29. WAP to accept a 3x3 matrix & display the sum of Columns. 30. WAP to accept a 3x3 matrix & display ...