Skip to content
VUBuddy

CS310 Assignment 2 Solution Fall 2026

Open Source Web Application Development Lesson 5: Week 5 20 marks Solution updated 17 Nov 2026

About CS310 Assignment 2

CS310 Assignment No 2 for Fall 2026 is from Open Source Web Application Development. It covers lesson 5: Week 5, carries 20 marks and is due on VULMS by 11:59 pm on Sunday 22 November 2026. The solution is on this page, with the assignment file.

Course
CS310 Open Source Web Application Development
Assignment
Assignment No 2
Semester
Fall 2026
Lesson
5: Week 5
Total marks
20
End date
Sun 22 Nov, 11:59 pm

What CS310 Assignment 2 asks

This assignment focuses on developing PHP programming skills through two distinct tasks. The first task involves creating a user-defined function to calculate product discounts based on price and percentage parameters. The second task requires processing form data submitted via the POST method. Students must write clean PHP code that performs calculations and retrieves input values for display.

  1. Question No. 1

    10 marks

    Create a PHP program with a user-defined function named calculateDiscount() that accepts product price and discount percentage as parameters. The function must calculate the discount amount and return the final price. You are required to call this function three times with different values, store the results in variables, and display them using echo with appropriate code comments.

  2. Question No. 2

    10 marks

    Write a PHP script to process student information submitted via the POST method, specifically studentName, email, and program. Retrieve these values using the $_POST array, store them in individual variables, and display them in a readable format using echo. Do not create an HTML form; focus solely on the PHP processing logic and include comments.

What to submit
One .php file containing the code for both questions.
Topics covered
PHP user-defined functions Function parameters and return values Arithmetic operations POST method Form data processing PHP variables

A summary of the assignment file, Fall 2026_CS310_2.docx. Download the file for the full wording before you start.

Lesson covered

Lesson 5: Week 5 CS310 · Open Source Web Application Development

The questions in this assignment come from this lesson. Read it in the CS310 handout before you open the assignment file, then practise it with the MCQs and past papers.

Solution

The solution for CS310 Assignment No 2 was added on 17 Nov 2026. It answers the questions in the assignment file, Fall 2026_CS310_2.docx.

CS310_Assignment_2_Solution_2026.php 2 KBAdded 17 Nov 2026Prepared by Malik Musab
Solved it yourself? Share your solution with other CS310 students. We check it before it goes up here.
Submit your solution

Before you submit on VULMS

  1. 1 Solve the questions in the assignment file yourself first, then use the solution to check your method and answers.
  2. 2 Write the final answer in your own words. VU checks assignments for copying, and copied work gets zero marks.
  3. 3 Save your answer in the file type the assignment file asks for, and name it with your student ID, for example BC260012345.
  4. 4 Open the file once more to check it is not empty or corrupted, then upload it on VULMS before 11:59 pm on Sun 22 Nov.

Questions about this assignment

When is CS310 Assignment 2 due?

Sunday 22 November 2026 at 11:59 pm. VULMS does not accept files after the deadline.

Is the CS310 Assignment 2 solution free?

The assignment file is free with no limit. The solution counts toward your daily downloads: 3 a day on the web, 30 a day with the free Chrome extension, 100 a day with Pro Semester and unlimited in the Android app.

Can I submit the solution as it is?

No. VU checks assignments for copying, and copied work gets zero marks. Use the solution to check your method, then write your own answer.

What file do I submit?

The assignment file says which file type to upload and lists any extra instructions from your instructor. Name the file with your student ID before you upload it on VULMS.

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.