Академический Документы
Профессиональный Документы
Культура Документы
Practice Problems
Find velocity from given distance and time Find acceleration from given velocity and time Calculate area of a rectangle ( area = base * height ) Calculate marks percentage ( marks percentage = marks obtained / total * 100 ) Find no. of minutes and no. of seconds from given no. of hours r (where F = mv2 / r)
10. Find the value of F (centripetal force) for given values of mass m, velocity v and radius 11. Find the value of A such that
A = (4x 3y) / 2z
12. Find the value of distance D for given values of x, v,t, a (where D = x + vt + 1/2at2)
13. Find the value of A such that
A = (a - b)2 / 2c
14. Find the value of E (total energy) for given values of m, v, g, h (where E = mv2 / 2 + mgh)
15. Find the value of A such that
A = (a + b)2 2ab
18. Find whether a numbers is negative or not 19. Find whether two numbers are equal or not 20. Multiply two numbers if their difference is greater than 0 21. Find whether the sum of two numbers is greater than 50 22. Find whether the sum of two numbers is greater than the third number 23. Divide a number by another if and only if the second number is not equal to 0 24. Determine whether a student is passed or failed from his marks 25. Divide two numbers if their difference is greater than 10, otherwise multiply them. 26. Determine whether the average of two numbers is negative or not. 27. Multiply two numbers if their sum is greater than 100, otherwise divide them. 28. Determine whether the Product of two numbers is negative or not. 29. Subtract two numbers if their sum is greater than 100, otherwise divide them. 30. Determine whether the average of three numbers is negative or not.
31. Find sum of two numbers (If
Practice Problems
If either the marks for both of the subjects are greater than 40 or GPA is greater than 2, hes considered passed
36. Determine whether a student has got Grade A from his total marks and his GPA
If marks are greater than 80 and less than 90 OR GPA is greater than 3.7 and less than 3.8, hell be graded A
37. Determine whether a car is of mid-size type or not from its price (in millions) and engine capacity (in cc)
If price is between 1 million and 2 million or if engine capacity is between 1000 and 1500, a car is considered to be a mid-size car
38. Determine whether a cell-phone is a smart phone or not, from its price and display width
A cell-phone is considered a smart-phone, if its price is from 20,000 to 30,000 or its display width is from 5 to 8 inches
39. Determine whether an employee is Manager or not, from given salary and pay grade.
An employee is considered a Manager, if his salary is between 50,000 to 80,000 or his pay grade is from 19 to 22
40. Determine whether an employee is an Executive or not, from given salary and pay grade.
An employee is considered an Executive, if his salary is between 80,000 and 100,000 or his pay grade is from 20 to 22
If second number is greater than 0, divide them If second number is less than 0, multiply them If second number is equal to 0, add them
42. For given roll number of a student, display his name
45. For given day number of the week, display the corresponding day 46. Find season from given month number 47. Calculate base pay from given annual salary and pay type
Instructor: Nadia Mushtaq All Rights Reserved to Department of Computer Science UOL 2
Practice Problems
1 2 3
52 24 12
90 or above 85 to 89 75 to 84 65 to 74 50 to 64 Below 50
A+ A B C D F
49. Perform the appropriate operation on given two numbers depending upon the given operation type
Operation Type Description
1 2 3 4
50. Find temperate in Celsius or Fahrenheit from given temperature and conversion type
Conversion Type Description Formula
1 2 3 4
51. Find weight in appropriate unit from given weight in kilograms and conversion type
Conversion Type Description Formula
1 2 3 4
Instructor: Nadia Mushtaq All Rights Reserved to Department of Computer Science UOL 3
Practice Problems
56. Find sum of first n even numbers 57. Find sum of first n odd numbers 58. Find/Display first n even numbers 59. Find/Display first n odd numbers 60. Find sum of numbers between any two integers 61. Display multiplication table of a number up to n
62. Find sum of first n integers numbers starting from 26
11
16
22
64. Find/Display first n numbers of Fibonacci (fee bo naachi) series 65. Find the sum of reciprocals of first n a. integers i.e., 1 + 1/2 + 1/3 ++ 1/n b. odd numbers i.e., 1 + 1/3 + 1/5 ++ 1/n c. even numbers i.e., 1/2 + 1/4 + 1/8 ++ 1/n 66. Display the first n numbers of the following series:
a. b. 1/4 1/3 1/16 1/9 1/25 1/64 1/27 1/125 1/256 1/81
c. 1/5
1/625
Practice Problems
80. From first n integers, find all numbers which are divisible by a number and its square, only if the given number is not equal to 0 81. From first n integers, find all numbers which are divisible by a number and its cube, only if the given number is not equal to zero 82. Between any two integers, find the product of all numbers which are divisible by 3 or 7
85. Find prime numbers from first n integers 86. Find prime numbers between any two integers 87. Find kth powers of first n integers
22
33
44 nn
89. Find odd prime numbers from first n integers (or between any two integers) 90. Find even prime numbers from first n integers (or between any two integers)
91. Find sum of factorials of first n integers (Hint: Factorial of a number = 1 2 num) 92. Display multiplication tables of first n integers
http://owl.english.purdue.edu/owl/resource/601/01/
Instructor: Nadia Mushtaq All Rights Reserved to Department of Computer Science UOL 5