Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


CS310 Open Source Web Application Development (PHP, PERL, CGI, Mysql) Assignment Fall 2020 Solution / Discussion Due Date:

Assignment No. 02
Semester:

CS310: Open Source Web Application Development 

Total Marks: 20

Week Covered: 4 to 6

Due Date: 16th December 2020

Instructions:

Please read the following instructions carefully before submitting the assignment. It should be clear that your assignment will not get any credit if:

§  The assignment is submitted after the due date.

§  The submitted assignment does not open or the file is corrupt.

§  Assignment is copied(partial or full) from any source (websites, forums, students, etc)

 

Note: You have to upload the .PHP file containing the PHP code of both questions. Assignment in any other format (extension) will not be accepted and will be awarded zero marks.

 

Objective:

The objectives of this assignment are:

·      To learn and practice switch statements using basic PHP code.

·      To learn and practice loops and arrays using basic PHP code.

 

Note:

·      This assignment is a Graded Assignment.

·      The assignment submitted through email will not be accepted.

·      This assignment is covering Lectures from Week 4-6.

 

Guidelines:

§  Code should be properly indented.

§  You can use the following tools/software:

o   Notepad,  Adobe Dreamweaver,  XAMPWAMP Server           

For any query about the assignment, contact at cs310@vu.edu.pk.

Question 1                                                                    10 Marks

Suppose you have recently joined SP Global organization as a developer. The organization assigned you the task of implementing the functionality of a web project “Online Computation Platform”. This project will provide the user the facility to perform online computations/calculations like (addition, subtraction, division, multiplication, etc.).

Being a PHP developer you are required to develop a web page that implements above functionality using the switch statement. The program should perform the calculations on two numbers only, you are also required to mention the type of operation to be performed.

1)    If the operation is ‘+’, then addition should be performed on the numbers.

2)    If the operation is ‘-‘, then subtraction should be performed on the numbers.

3)    If the operation is ‘*’, then multiplication should be performed on the numbers.

4)    If the operation is ‘/’, then division should be performed on the numbers.

5)    If the operation is other than the above option, an Invalid operation should be displayed on the web page.

 

Question 2                                                                              10 Marks

Lahore Creative School system conducted an online test of Mathematics for its Sixth Standard students. Only 5 students participated in that test. Now the higher authorities of Creative School want to find out who among the students have scored the highest marks in the test.

Being a PHP developer you are required to develop a webpage that will find out the highest score of a student. The marks that the students obtained in the test are 32, 44,77,55,49.

 

HINT: (Use arrays and loops to implement this functionality)

BEST OF LUCK!

Views: 119

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS310 Open Source Web Application Development (PHP, PERL, CGI, Mysql) Assignment Fall 2020 Solution 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>vu assignment</title>



   

</head>

<body>

    

<form method="POST">

<div>

          &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  <input type="text" name="firstNumber" id="num1" placeholder="Enter first Number.." style="">

          <br><br>

          &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="optr" id="optr" placeholder=" Enter +,-,*,/"><br><br>

          &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="secondNumber" id="num2" placeholder="Enter second number.."><br><br>

           

          &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" name="submit" value="submit">

             

</div>



</form>



  <?php

if(isset($_POST['submit'])){



  $NUM1=$_POST['firstNumber'];

  $OPTR=$_POST['optr'];

  $NUM2=$_POST['secondNumber'];

  

  switch($OPTR){

  case '+':

    echo "Addition of  number = ".$NUM1+$NUM2;

    break;

  case '-':

    echo "Subtraction of  number = ".$NUM1-$NUM2;

    break;

  case '*':

    echo "Multiplication of  number = ".$NUM1*$NUM2;

    break;

  case '/':

    echo "Division of  number = ".$NUM1/$NUM2;

    break;

    default:

    echo "Option is invalid";

    

  }

return 0;

}




?>



</body>

</html>

#cs310 #cs310Assignment #virtual
CS310 assignment solution Fall 2020

#cs310 #cs310Assignment #virtual
CS310 assignment solution Fall 2020

CS310 Assignment 2 Fall 2020 Solution idea:

 

CS310 Assignment 2 Fall 2020 Soluion:

 

Source code:

<!DOCTYPE html>

<html lang="en">

<head>




<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>vu assignment</title>






</head>

<body>



<form method="POST">




<div>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="firstNumber" id="num1" placeholder="Enter first Number.." style="">

<br><br>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="optr" id="optr" placeholder=" Enter +,-,*,/"><br><br>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="text" name="secondNumber" id="num2" placeholder="Enter second number.."><br><br>



&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" name="submit" value="submit">



</div>




</form>




<?php




if(isset($_POST['submit'])){




$NUM1=$_POST['firstNumber'];

$OPTR=$_POST['optr'];

$NUM2=$_POST['secondNumber'];



switch($OPTR){

case '+':

echo "Addition of number = ".$NUM1+$NUM2;

break;

case '-':

echo "Subtraction of number = ".$NUM1-$NUM2;

break;

case '*':

echo "Multiplication of number = ".$NUM1*$NUM2;

break;

case '/':

echo "Division of number = ".$NUM1/$NUM2;

break;

default:

echo "Option is invalid";



}

return 0;

}

CS310 Assignment Solution # 2 Fall 2020

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service