Assignment 1
Assignment 1
(1) WAP to print the pattern of your name at center of screen using single echo statement.
(2) WAP to print the pattern of your name at center of screen using multiple echo statements.
(3) WAP which initializes 2 numbers and prints its addition, subtraction, multiplication, division
and modules values.
(4) WAP to calculate area and circumference of a circle.
(5) WAP to calculate area and perimeter of a triangle.
(6) WAP to calculate area and perimeter of a rectangle.
(7) WAP which converts the temperature from Fahrenheit to Celsius. (Hint: C=(F-32)/1.8)
(8) WAP to calculate the simple interest and compound interest.
(9) WAP to initializes the following values and calculates its gross salary.
Quantity, Price, Commission rate, Bonus rate, Base salary.
(Hint: Commission= Quantity * Price * Commission rate
Bonus=Commission * Bonus rate
Gross salary=Commission + Bonus + Base salary)
(10) If the price of an item is in decimal form e.g. 12.50 then separate rupees and paisa from the
given value. i.e. output
of your program will be 12 rupees and 50 paisa.
(11) WAP to swap the values of 2 variables without using any extra variable. i.e. if user enters
a=10 and b=20 then
output of your program will be a=20 and b=10.
(12) WAP to swap the values of 3 variables without using any extra variable. i.e. if user enters
a=10, b=20 and c=30 then
output of your program will be a=20, b=30 and c=10.
Page 1 of 2
SMT. CHANDABEN MOHANBHAI PATEL INSTITUTE OF COMPUTER APPLICATIONS
CHAROTAR UNIVERSITY OF SCIENCE AND TECHNOLOGY,
CHANGA – 388 421
Branch: B.C.A Semester: IV
Course Code: CA235
Course Name: Open Source Technologies
Component: Practical Assignment – 1
Topics Covered: Expressions, Operators and Control Statements
Submission Date: 20/01/2025
(13) WAP to convert the paisa into rupees and paisa.
(14) WAP to convert the seconds into hours, minutes and seconds.
(15) WAP to convert the days into years, months and days.
(16) WAP to check whether the given year is leap year or not? (Using if)
(17) WAP to check whether the given no. is odd or even? (Using if else)
(18) WAP to display the grades on mark sheet. (Using if else ladder)
(19) WAP to check whether the no. is positive, negative or zero? (Using if else ladder)
(20) WAP to make a simple calculator. (Using if else ladder)
(21) WAP to find out the solutions of quadratic equations. (Using if else ladder)
(22) WAP to check whether the no. is divisible by 2, 3, 5 or not? (Using nested if)
(23) WAP to initialize three numbers and find out the max. And min. numbers out of these.
(Using nested if else)
(24) WAP to display equivalent grade according to the following table. (Using switch)
Percentage Grade
70-100 Distinction
60-70 First Class
50-60 Second Class
40-50 Pass
0-39 Fail
(25) WAP to make a simple calculator. (Using switch)
Page 2 of 2