rohidas

Hi I am Rohidas lande.I have teaching in C.D.jain college of commerce Shrirampur .I have Nine year in teaching Experience to teach various programming langauge,script languages,databases like Java,C,C++,php,python,html,css,javascript,mysql,oracle.

University of Pune BBACA Lab book CA-306 -PHP Basic of PHP assignment SOLUTION

Savitribai Phule Pune University S. Y. B. B. A. (C. A.) Semester-III (CBCS 2019 Pattern) CA-306: Lab Book Credits-03 Assignment 1:Basics in PHP PHP ASSIGNMENT
Sr.NoAssignment name
Set-A
1
Write a PHP script to display Quotient and Remainder of division of two variables. Plz Click on Question to see Answer

<?php $num1=22; $num2=11; $quotient=$num1%$num2; $remainder=$num1/$num2; echo"Remainder of the operation is: ".$remainder; echo"<br>"; echo"Quotient of the operation is: ".$quotient; ?>


2
Write a PHP script to swap the values of two variables. Plz Click on Question to see Answer

<?php $in1=15; $in2=10; echo"Before swapping values of Input 1: ".$in1; echo"<br>"; echo"Before swapping values of Input 2: ".$in2; echo"<br>"; $temp=$in1; $in1=$in2; $in2=$temp; echo"<br>After swapping value of Input 1; ".$in1; echo"<br>"; echo"After swapping value of Input 2: ".$in2; ?>


3
Write a PHP script which will convert temperature from celcius(C)to Farenheit(F).(Hint:C=5.0/9(F-32) Plz Click on Question to see Answer

<?php $celsius = 5; $fahrenheit= NULL; $fahrenheit = (float)(($celsius * 9 / 5) + 32); printf($celsius . " Celsius = " . $fahrenheit . " Fahrenheit"); ?>


Set-B
1
Write a PHP script to display the surface area and volume of a cuboid.(Hint:surface area=2(lb+lh+lb),volume=l*b*h) Plz Click on Question to see Answer

<?php $length=10; $breadth=4; $height=8; $surface_area=2*($length*$breadth+$length*$height+$breadth*$height); $volume=$length*$breadth*$height; echo"Users inputs are:<br>"; echo"Length of a cuboid is: ".$length; echo"<br>"; echo"Breadth of a cuboid is: ".$breadth; echo"<br>"; echo"Height of a cuboid is: ".$height; echo"<br>"; echo"Surface area of a cuboid is: ".$surface_area; echo"<br>"; echo"Volume of a cuboid is: ".$volume; ?>


2
Write a PHP script to calculate the area of Circle, Square, and Rectangle. Plz Click on Question to see Answer

<?php $radius=4; $side=5; $length=7; $breadth=4; $area_of_rectangle=$length*$breadth; $area_of_square=$side*$side; $area_of_circle=3.14*$radius*$radius; echo"Users inputs are:<br>"; echo"<hr>"; echo"Radius of a Circle is: ".$radius; echo"<br>"; echo"Side of a Square is: ".$side; echo"<br>"; echo"Length of a Rectangle is: ".$length; echo"<br>"; echo"Breadth of a Rectangle is: ".$breadth; echo"<br>"; echo"<hr>"; echo"Area of Circle: ".$area_of_circle; echo"<br>"; echo"Area of Square: ".$area_of_square; echo"<br>"; echo"Area of Rectangle: ".$area_of_rectangle; ?>


3
Write a PHP script to display the total and percentage of Marks of Subjects(Out of 100)DataStructure,Digital Marketing,PHP,Software Engineering and Big Data. Plz Click on Question to see Answer

<?php $data_structure=80; $php=85; $digital_marketing=82; $big_data=93; $se=95; $total=500; $total_marks=$data_structure+$php+$digital_marketing+$big_data+$se; $percentage=$total_marks/$total*100; echo"Subjects Marks :"; echo"<hr>"; echo"<ol>"; echo"<li>Data Structure: ".$data_structure; echo"/100"; echo"<br>"; echo"<li>PHP: ".$php; echo"/100"; echo"<br>"; echo"<li>Digital Marketing: ".$digital_marketing; echo"/100"; echo"<br>"; echo"<li>Big Data: ".$big_data; echo"/100"; echo"<br>"; echo"<li>Software Engineering: ".$se; echo"/100"; echo"</ol>"; echo"<hr>"; echo"Total of Marks is: ".$total_marks; echo"/500"; echo"<b>"; echo"<br>; echo"Percentage of a Student (out of 100) is:  ".$percentage; echo"%"; ?>


Set-C
1
Write a php script to calculate the total cost of AIR Ticket Reservation and display for Name,Address,Contact No,Sourse,Destination,Date of journey,gender of passanger,no of passanger,price per ticket. Plz Click on Question to see Answer

<html> <head><center><b>< font face="Lucida Fax" color="red" size="7">AIR TICKET RESERVATION</center></font></b></head> <body> <form action="input.php" method="POST" target="_self"> <h2><center>APPLICATION FORM</center></h2> <fieldset> <legend>Passenger's Information</legend> <label>Name:</label><br> <input type="text" placeholder="Enter your Full Name" name="name" required><br><br> <label>Address:</label><br> <input type="text" name="address" placeholder="Enter your Address" required><br><br> <label>Contact No:</label><br> <input type="text" maxlength="10" name="contact" placeholder="Enter your Contact no"required><br><br> <label>Source Station:</label><br> <select name="source"><br> <option value="Kolhapur" name="source">Kolhapur Air Station</option> <option value="Kolhapur" name="source">Shrirampur Air Station</option> <option value="Kolhapur" name="source">Ganeshnagar Air Station</option> <option value="Kolhapur" name="source">Rahata Air Station</option> <option value="Kolhapur" name="source">Manmad Air Station</option> <option value="Kolhapur" name="source">Nashik Air Station</option> </select> <br> <br> <label>Destination Station:</label><br> <input type="text" name="destination" size="30" placeholder="Enter your Destination Bus Station"required><br><br> <label>Date of Booking:</label><br> <input type="date" maxlength="10" name="date" required><br><br> <label>Date of Journey:</label><br> <input type="date" name="journey" required><br><br> <label>No of Passanger:</label><br> <input type="text" name="value1" placeholder="Enter no of passangers" required><br><br> <label>Gender:</label> <input type="radio" name="gender" value="male" required>Male     <input type="radio" name="gender" value="Female" required>Female<br><br> <label>Price per Ticket:</label> <input type="text" name="value2" placeholder="e.g Rs.1000" required><br><br> <input type="submit" name="btnsubmit"> <input type="Reset" name="btnreset"><br><br> <label> (Note: All the Fields must be filled Properly.)</label> </fieldset> </form> </body> </html> PHP Program : <?php $value1= $_POST['value1']; $value2= $_POST['value2']; $a = $_POST['contact']; $date= $_POST['journey']; $gender=$_POST['gender']; echo"<font face=arno pro caption size=7>"; echo"<center>PASSENGER'S DETAILS...</center>"; echo"<font face=calibri size=4>"; echo"<hr>"; echo"<ul>"; echo"<li>Passenger's Name: "; echo $_POST['name']; echo"<br>"; echo"<li>Address: "; echo $_POST['address']; echo"<br>"; echo"<li>Contact No: "; echo $_POST['contact']; echo"<br>"; echo"<li>Source: "; echo $_POST['source']; echo"<br>"; echo"<li>Destination: "; echo $_POST['destination']; echo"<br>"; echo"<li>Date of Journey: "; echo $date; echo"<br>"; echo"<li>Gender of Passenger: "; echo $gender; echo"<br>"; echo"<li>No. of Passengers: "; echo $_POST['value1']; echo"<br>"; echo"<li>Price per Ticket: "; echo $_POST['value2']; echo"<br> </ul> <hr>"; $total=$value1*$value2; echo"<center>"; echo"Your Total cost of air ticket Reservation is:  Rs.".$total; echo"<br>"; echo"Thank You for Choosing us..!"; echo"<hr>"; echo"<center>"; echo"</center>"; echo"</font>"; ?>


Post a Comment

0 Comments