 ## डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग ## Full Stack Web Development with Laravel # PHP assignment programs

1. Print your name using marquee tag
2. Print your personal details using single echo function
3. Print your name of city using font tag.
4. Write a program to swap two number using third variable.
5. Write a program to swap two number without using third variable and print them using h1 tag.
6. Write a program to calculate area, perimeter of circle, square, rectangle, and triangle.

## Program based upon variables declaration and initialization

1. Create a program to declare and initialize variables for given formulas and also print them.
1. Circle
1. area= πr2
2. perimeter = 2*π*r
2. Square
1. area= side * side
2. perimeter = 4*side
3. Rectangle
1. area= length * width
2. perimeter= 2*(length + width)
4. Right angle triangle
1. area= (base*height)/2
2. perimeter= side1+side2+side3
5. Volume
1. Cube
1. v=a3
2. Cylinder
1. v=b*h
3. Cone
1. v= b*h/3
4. Sphere
1. v=4πr3
2. Swap two number using third variable.
3. Swap two number without using third variable.
4. Find of number of rupees note of 2000, 500, 200 in given amount.
5. Program to calculate simple interest.
6. Check number is even or odd.
7. Check person is eligible for vote or not.
8. Check two number are equal or not.
9. Find out largest number in given two number.
10. Check given year is leap year or not.
11. Check given number is divided by 5 or not.
12. Check given number is divided by 5 or 7.
13. Check given number is divided by 11 and 17.
14. Check two variables are not equal.
15. Display name of days corresponding digit 1-7.
16. Display name of months corresponding digit 1-12.
17. Check student is pass or not in given three subject marks, where passing marks must be greater than 33.
18. Find out grade of student in 10th class.
• A - where % is greater than 90
• B - where % is greater than 80
• C - where % is greater than 70
• D - where % is greater than or equal 60
• E - where % is less than 60
19. Calculate addition, subtraction, multiplication and division by selecting choices from 1-4 using switch statement.
20. Check number is even or odd using conditional statement.
21. Find out largest number is given three number.

## For loop programs

1. Display numbers for given range.
1. 1 to 100
2. 100 to 1
3. -10 to 10
4. 10 to -10
5. -10 to -20
2. Display only even numbers in given range (1-100)
3. Display only odd numbers in given range(32 - 64)
4. Program to count, calculate sum and multiplication in given range(1-7)
5. Check number is prime or not.
6. Find out factorial of given number.
7. Display table of a given number.

## while loop programs

1. Display numbers for given range.
1. 1 to 100
2. 100 to 1
3. -10 to 10
4. 10 to -10
5. -10 to -20
2. Display only even numbers in given range (1-100)
3. Display only odd numbers in given range(32 - 64)
4. Program to count, calculate sum and multiplication in given range(1-7)
5. Check number is prime or not.
6. Find out factorial of given number.
7. Display table of a given number.
8. Display digits of a given number.
9. Count, calculate sum and multiplication of digits available in given number.
10. Check number is palimdrome number(11, 121, 1221) of not.
11. Check number is armstrong number(1, 153) or not.
12. Check number is special number (1, 145) or not.

## do-while loop programs

1. Display numbers for given range.
1. 1 to 100
2. 100 to 1
3. -10 to 10
4. 10 to -10
5. -10 to -20
2. Display only even numbers in given range (1-100)
3. Display only odd numbers in given range(32 - 64)
4. Program to count, calculate sum and multiplication in given range(1-7)
5. Check number is prime or not.
6. Find out factorial of given number.
7. Display table of a given number.

## Nested loop programs

1. Display all prime numbers from 1 to 100.
2. Display table of numbers from 1 to 10.

## Pattern Programs(Nested loop programs)

```111
222
333```

```123
123
123```

```666
666
666```
```123
456
789```
```987
654
321```
```****
****
****
****```

```*
**
***
****```

```****
***
**
*```

```   *
**
***
****```

```****
***
**
*```

```   *
***
*****
*******```

```*******
*****
***
*```

## Programs based upon arrays

Store given records in a multi dimension array.

 Name Price Qty Mobile 12000 2 CPU 9000 1 UPS 13000 4

Store given records in a multi dimension array and calculate sum of price and count all the quantities.

 Name Price Qty Laptop 45000 4 Shoes 3500 3 Jeans 2200 4

Store the give records in the array and display them with html table

 Name Price Qty Mobile 12000 2 CPU 9000 1 UPS 13000 4

Display only those product details which are active.

 Name Price Qty Status Mobile 12000 2 0 CPU 9000 1 1 UPS 13000 4 0 Jeans 2300 5 1 Shirt 1800 2 0

Display all those products and mark not available on the product that does not have more quantity to add cart.

 Name Price Qty Status Mobile 12000 2 0 CPU 9000 0 1 UPS 13000 4 0 Jeans 2300 0 1 Shirt 1800 2 0

```<?php
\$products=[
[
"id"=>1,
"name"=>"UPS",
"price"=>450,
"sale_price"=>350,
"qty"=>45,
"ratings"=>[
[
"id"=>1,
"user_id"=>1,
"rate"=>4.5
],
[
"id"=>2,
"user_id"=>2,
"rate"=>5
],
[
"id"=>3,
"user_id"=>3,
"rate"=>3.5
],
[
"id"=>4,
"user_id"=>4,
"rate"=>2
],
[
"id"=>5,
"user_id"=>5,
"rate"=>5
],
]
],
[
"id"=>2,
"name"=>"Desktop",
"price"=>9000,
"sale_price"=>8500,
"qty"=>20,
"ratings"=>[
[
"id"=>1,
"user_id"=>1,
"rate"=>5
],
[
"id"=>2,
"user_id"=>2,
"rate"=>4
],
[
"id"=>3,
"user_id"=>3,
"rate"=>3.5
],
[
"id"=>4,
"user_id"=>4,
"rate"=>2.5
],
[
"id"=>5,
"user_id"=>5,
"rate"=>5
]
]
],
[
"id"=>3,
"name"=>"DSLR",
"price"=>85000,
"sale_price"=>69000,
"qty"=>5,
"ratings"=>[
[
"id"=>1,
"user_id"=>1,
"rate"=>4
],
[
"id"=>2,
"user_id"=>2,
"rate"=>5.5
],
[
"id"=>3,
"user_id"=>3,
"rate"=>3
],
[
"id"=>4,
"user_id"=>4,
"rate"=>2.5
],
[
"id"=>5,
"user_id"=>5,
"rate"=>5
]
]
]
];
?>```