- Design a class Rectangle
data members[box title=”” bg_color=”#dbdbdb” align=”left”]length
breadth[/box]member functions/methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension()
area()
perimeter()[/box] - Design a class Worker
data members[box title=”” bg_color=”#dbdbdb” align=”left”]wages
wdays[/box]member function / method[box title=”” bg_color=”#dbdbdb” align=”left”]setData()
payment()[/box] - Design a class Box
data members[box title=”” bg_color=”#dbdbdb” align=”left”]length
breadth
height[/box]member functions / methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension()
volume()[/box] - Design a class Rectangle (only for Java / C++)
data members[box title=”” bg_color=”#dbdbdb” align=”left”]length
breadth[/box] member functions / methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension()
area()
perimeter()[/box]It must overload setDimension() method twice:- by passing 1 argument
- by passing 2 arguments
- Design a class Box (only for Java / C++)
data members[box title=”” bg_color=”#dbdbdb” align=”left”]length
breadth
height[/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”]volume()[/box] It must contain 3 constructors- 1 parameter
- 2 parameter
- 3 paramter
- Design a class Account
data members [box title=”” bg_color=”#dbdbdb” align=”left”]balance[/box]member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] deposit(amt)
withdraw(amt)
showBalance()[/box] - Design a class Set
data members [box title=”” bg_color=”#dbdbdb” align=”left”]3 numbers[/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] SUM()
MEAN()
MAX()
MIN() [/box] - Design a class Student
data members [box title=”” bg_color=”#dbdbdb” align=”left”]roll_number
name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] setData()
getData() [/box] - Design a class Account
data members [box title=”” bg_color=”#dbdbdb” align=”left”] balance
interest_rate [/box] interest_rate must be shared by all objects (static modifier) and its default value 10.25 [box title=”” bg_color=”#dbdbdb” align=”left”] interest(no_of_years) [/box] - Design a class Student
data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number
name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] setData()
getData() [/box] - Design a class Account
[box title=”” bg_color=”#dbdbdb” align=”left”] account_number
balance
interest_rate [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] interest(no_of_years) [/box] - Design a class Student
data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number
name [/box] member function / methods [box title=”” bg_color=”#dbdbdb” align=”left”] getData() [/box] roll_number must be automatically generated.It also keep track of total number of Students. - Design a package MyCircle and MyRectangle (Only for Java)
[box title=”” bg_color=”#dbdbdb” align=”left”] radius
length
breadth [/box] member functions / methods: [box title=”” bg_color=”#dbdbdb” align=”left”] area()
circumference()
perimeter() [/box] - Design a class Student
data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number
name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] getData()
showData() [/box] Create 5 objects of Student using Array - Design a class Student and List ClassRoom
add list of Students in ClassRoom
display List - Design a class Account and List Bank
add list of Account in Bank
display List - Create array of Student Objects
data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_no
name
college [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] readData()
showData() [/box] - Create a class RBI (Only for Java)
data members [box title=”” bg_color=”#dbdbdb” align=”left”] balance [/box] member functions [box title=”” bg_color=”#dbdbdb” align=”left”] RBI()
deposit(int amt)
withdraw(int amt)
showBalance() [/box]
Category: Php
AJAX Using jQuery and Php
Arrays Programs (Multi Dimensional)
- WAP to read a matrix of size 3 X 5 and find their SUM
- WAP to read a matrix of size 3 X 5 and find sum of each ROW
- WAP to read a matrix of size 3 X 3 and check if it is NULL or NOT
- WAP to read a matrix of size 3 X 5 and count all EVEN and ODD numbers
- WAP to read matrix of size 3 X 3 and check if it is UNIT Matrix or NOT
- WAP to read 2 matrix of size 3 X 3 and find their Addition
- WAP to read 2 matrix of size 3 X 3 and find their Product
- WAP to read matrix of size 3 X 3 and find its Transpose
- WAP to read matrix of size 3 X 3 and find its Transpose without using second matrix
- WAP to read matrix of size 3 X 3 and find its Upper Triangular Matrix
- WAP to read matrix of size 3 X 3 and find its Lower Triangular Matrix
- WAP to read matrix of size 3 X 3 and check if sum of its diagonal is same or not
- WAP to read matrix of size 3 X 3 and check if sum of its middle row is same as sum of its middle column
- WAP to create TIC-TAC-TOE by showing number and take 9 inputs from 2 users.
[box title=”” bg_color=”#dbdbdb” align=”left”]1 2 3
4 5 6
7 8 9
[/box]
[box title=”” bg_color=”#dbdbdb” align=”left”]X O X
O X O
O O X
[/box]
PLAYER 1 WIN
[box title=”” bg_color=”#dbdbdb” align=”left”]O X O
X O X
O X O
[/box]
PLAYER 2 WIN
Arrays Programs (One Dimensional)
- WAP to read an array of 10 numbers and find their sum
- WAP to read temperature days of Week and find their Mean
- WAP to read an array of 10 numbers and find greatest of them
- WAP to read an array of 10 numbers and count all EVEN and ODD numbers
- WAP to rad an array of 10 numbers and find sum, mean, min, max
- WAP to read an array of 10 numbers and search a number in it
- WAP to read an array of 10 numbers and sort it in ascending order
- WAP to read an array of 10 numbers and sort it in descending order
- WAP to insert a number at given position in an array (optional)
- WAP to remove a number from given position from an array (optional)
- WAP to arrange all even numbers at top and all odd numbers at bottom of an array (optional)
FUNCTIONS
- WAF repeat to display a char specified no of times.
- WAF intrest to calculate simple intrest.
- WAF to return Volume of Sphere
- WAF to return mean of 3 numbers
- WAF to return greatest of 2 numbers
- WAF to return Factorial of given Number
- WAF to return Sum of Given Number.
- WAF to return Greatest of 3 numbers.
- WAF to print all numbers from 1 to given numbers
- WAF to repeat a given char given number of timest.
e.g. repeat(‘#’, 25) - Design a recursive function factorial to return factorial of given number.
- Design a recursive function intrest to return compound intrest.
- Design a recursive function SOD to return sum of digit of given number.
-
WAF to return sum of number which is passed in a Array.
-
WAF to return Mean of numbers which is passed in a Array.
-
WAF to return Greatest number which is passed in a Array.
SWITCH Statement
- WAP to read a single digit number and print that number in words.
- WAP to read month in digits print it in words.
- WAP to read a single number and print all numbers from 1 to that number in words.
- WAP to read a color code (char value) and print appropriate color.
(e.g. R – Red, G- Green, B-Blue and other char – Black) - WAP to read 2 numbers and a Operator sign and perform the operation according to operator.
(e.g.
i/p:
5
7
+
5+7=12
)
- WAP to count total number of vowels in a string by using a switch statement
- WAP to count total number of vowels of each type
Loops Programs
EXACT OUTPUT IS OPTIONAL FOR PYTHON AND JAVASCRIPT
WAP to read a number and print all numbers from 1 to that number
Input: Enter a number: 5
Output:
1
2
3
4
5
WAP to read number and print all even numbers from 1 to that number
Input: Enter a number: 5
Output:
2
4
WAP to print all numbers from 1 to 10 using while, for, and do-while loop
WAP to read a number and find sum of all numbers from 1 to that number
Input: Enter a number: 5
Output: 1 + 2 + 3 + 4 + 5 = 15
WAP to read a number and find factorial of that number
Input: Enter a number: 5
Output: 1 * 2 * 3 * 4 * 5 = 120
WAP to read a number and check if it is a prime number or not
Input: Enter a number: 5
Output: 5 is a prime number
WAP to print all prime numbers in range from 1 to 100
Output:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97
WAP to print first 10 Fibonacci numbers
Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
WAP to print table of number in following format using 1 for loop
Input: Enter a number: 5
Output:
5 * 1 = 5 5 * 10 = 50
5 * 2 = 10 5 * 9 = 45
5 * 3 = 15 5 * 8 = 40
5 * 4 = 20 5 * 7 = 35
5 * 5 = 25 5 * 6 = 30
5 * 6 = 30 5 * 5 = 25
5 * 7 = 35 5 * 4 = 20
5 * 8 = 40 5 * 3 = 15
5 * 9 = 45 5 * 2 = 10
5 * 10 = 50 5 * 1 = 5
WAP to create random jackpot number and take input from user to guess the number
-
Based on level, the attempt to guess the number should change:
-
Easy – 20 attempts
-
Medium – 10 attempts
-
Difficult – 5 attempts
-
WAP to execute Fizz Buzz Problem / Print number 1 to 100
-
If number is divisible by 3 then print Fizz
-
If number is divisible by 5 then print Buzz
-
If number is divisible by both 3 and 5 then print Fizz Buzz
Programs on If Statement
Basic WAP (Write A Program) Questions
- Check if a number is even or odd
Input:
Enter a number: 5
Output:
Number 5 is odd
- Check if the last digits of two numbers are the same
Input:
Enter number 1: 55
Enter number 2: 45
Output:
Last digits of 55 and 45 are same
- Check if a triangle can be formed from 3 angles
Input:
Enter value for angle a: 50
Enter value for angle b: 60
Enter value for angle c: 70
Output:
Triangle can be formed
- Check if a triangle is equilateral
Input:
Enter value for angle a: 60
Enter value for angle b: 60
Enter value for angle c: 60
Output:
Triangle is equilateral triangle
- Check if student is passed based on marks of 5 subjects
Input:
Enter marks for maths: 50
Enter marks for science: 50
Enter marks for history: 50
Enter marks for english: 50
Enter marks for marathi: 50
Output:
Total Marks: 250
Percentage: 50%
Student is passed
- Find the greatest of two numbers
Input:
Enter number 1: 50
Enter number 2: 60
Output:
60 is greater than 50
- Find the greatest of three numbers
Input:
Enter number 1: 50
Enter number 2: 60
Enter number 3: 70
Output:
70 is greater than 50 and 60
- Check if the sum of cube of digits equals the number (Armstrong number)
Input:
Enter a 3 digit number: 153
Output:
Success: Sum of cube of 153 is 153
- Check if last digits of three numbers are the same
Input:
Enter number 1: 50
Enter number 2: 60
Enter number 3: 70
Output:
Last digits of 50, 60 and 70 are same
- Check if a number is a palindrome
Input:
Enter a number: 121
Output:
121 is palindrome number
- Print total, percentage and result (pass/fail) from 5 subject marks
Input:
Enter marks for maths: 50
Enter marks for science: 50
Enter marks for history: 50
Enter marks for english: 50
Enter marks for marathi: 50
Output:
Total Marks: 250
Percentage: 50%
Student is passed
- Check type of triangle based on angles
Input:
Enter value for angle a: 45
Enter value for angle b: 45
Enter value for angle c: 90
Output:
Triangle can be formed
The triangle is right angled triangle
- Check marriage eligibility based on age and gender
Input:
Enter gender M or F: M
Enter your age: 30
Output:
30 ka ho gaya ab to shadi kar le
- Check if a year is a leap year
Input:
Enter year: 2004
Output:
Year 2004 is a leap year
- Calculate commission based on salary
Salary Commission
<10000 10%
10000-20000 12%
>20000 15%
Input:
Enter Salary: 10000
Output:
Your commission is 1000 Rupees
- Print division based on percentage
Percentage Division
>=75 1st class with distinction
60-75 1st class
50-60 2nd class
40-50 3rd class
<40 Fail
Input:
Enter marks for maths: 75
Enter marks for science: 75
Enter marks for history: 75
Enter marks for english: 75
Enter marks for marathi: 75
Output:
Total Marks: 375
Percentage: 75%
Student passed with 1st class Distinction
Basic Programs
1. WAP to read radius of circle and calculate Area and Circumference
Input:
Enter radius: 5
Output:
Area of circle is 78.5
Circumference of circle is 31.5
2. WAP to read 3 numbers and find their mean
Input:
Enter number 1: 5
Enter number 2: 6
Enter number 3: 7
Output:
Mean of 5, 6 and 7 is 6
3. WAP to read 2 numbers and find Sum of their last digit
Input:
Enter number 1: 52
Enter number 2: 65
Output:
2 + 5 = 7
4. WAP to read 4-digit number and sum of its digits
Input:
Enter a number: 1234
Output:
1 + 2 + 3 + 4 = 10
5. WAP to read radius of Sphere and find its Volume
Input:
Enter radius: 5
Output:
Volume of sphere having radius 5 is 523.6
6. WAP to read 3-digit number and sum of its digits
Input:
Enter a number: 123
Output:
1 + 2 + 3 = 6
7. WAP to read 4-digit number and find reverse of that number
Input:
Enter a number: 1234
Output:
Reverse of 1234 is 4321
8. WAP to read temperature in Celsius and convert it into Fahrenheit
Input:
Enter temperature in Celsius: 38
Output:
Temperature in Fahrenheit is 100.4
9. WAP to read value in inches and print it in feet and inches
Input:
Enter length in inches: 20
Output:
20 inches is equal to 1 foot and 8 inches
10. WAP to read marks of 5 subjects and print total and percentage
Input:
Enter marks for Maths: 50
Enter marks for Science: 50
Enter marks for History: 50
Enter marks for English: 50
Enter marks for Marathi: 50
Output:
Total Marks: 250
Percentage: 50%
11. WAP to read 2 numbers and exchange their values using third variable
Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5
12. WAP to read 2 numbers and exchange their values without using third variable
Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5
13. WAP to read Length, Breadth and Height and find its volume and surface area
Input:
Enter length: 5
Enter breadth: 6
Enter height: 7
Output:
Volume of box is 210
Surface area of box is 214