CS201P Assignment 1 Solution Fall 2026

CS201P Introduction to Programming (Practical) is the course where you turn logic into a working program. Assignment 1 for Fall 2026 carries 20 marks and the due date is 6 November 2026, and it asks you to write a C++ program that simulates a Community Water Refill Depot billing system. The program takes the last five digits of your student ID, turns them into five customer orders, applies a quantity discount, and classifies the daily sales. One important warning first: this assignment must be submitted only as a .cpp file on VULMS, and any other format gets zero marks.
The solution file linked below is a complete, working C++ program. It hard-codes the student name and ID, extracts the last five digits using the modulus and division operators exactly as the question requires, processes all five orders in a loop, applies the 10 percent discount where it applies, and prints the daily summary with the sales status. The program was compiled and run to verify that its output matches the expected output given in the question. Use it to understand the logic, then replace the name and ID with your own before submitting, because your own ID will produce your own digits and your own totals.
What Does the Solution File Cover?
The file covers the complete program for all five steps of the assignment. Step 1 displays the hard-coded student name and VU Student ID before any other output, with no user input anywhere in the program. Step 2 extracts the last five digits and builds the five orders. Step 3 applies the discount. Step 4 classifies the sales status. Step 5 prints the daily summary. The program uses only iostream, with no printf or scanf anywhere, since the question deducts marks for those.
How Are the Last Five Digits Extracted?
The program takes the numeric part of the student ID, 123456789, and first applies modulus 100000 to get 56789. Then it pulls out one digit at a time with division and modulus: 56789 / 10000 gives 5, the remainder 6789 / 1000 gives 6, the remainder 789 / 100 gives 7, the remainder 89 / 10 gives 8, and the final remainder 89 % 10 gives 9. Each digit is multiplied by 10 to get the quantity for one order: 50, 60, 70, 80 and 90 containers. The first three orders use 5-litre containers at Rs. 70 each, and the last two use 19-litre containers at Rs. 180 each.
How Is the Discount Applied?
An order gets a 10 percent discount when its quantity is 50 or more containers, otherwise no discount is applied. In the example all five quantities are 50 or more, so every order gets a discount: 350, 420, 490, 1440 and 1620, a total discount of Rs. 4320. The final charges are 3150, 3780, 4410, 12960 and 14580. The loop handles this with a simple if condition inside it, so the same code works for any student ID, including orders below 50 containers that get no discount.
What Is the Daily Summary and Sales Status?
After the loop, the program prints the daily summary: total containers supplied 350, total original charges Rs. 43200, total discount Rs. 4320, and final amount collected Rs. 38880. The status follows the question rules with if and else conditions: below Rs. 15000 is LOW SALES, Rs. 15000 to Rs. 29999 is NORMAL SALES, and Rs. 30000 or above is HIGH SALES. Since the final amount is Rs. 38880, the status is HIGH SALES.
How Do You Download the Solution File?
You can download the complete solution file from Google Drive using the link below. The file is a .cpp file, which is exactly the format VU requires for this assignment. Open it in Dev C++, replace the name and the student ID with your own, compile it, and check that your output matches your own digits before submitting the .cpp file on VULMS. Do not submit a Word document or PDF for this assignment, because those formats get zero marks.
How Should You Use This Solution?
A solution file helps most when you use it to learn, not just to submit. Read the digit extraction part first, because that is the trickiest logic in this assignment, and trace it by hand with your own ID. Then compile the program yourself and compare its output with your hand calculation. Fill in your own name and student ID in the program, since the question requires your own details, and submit only the .cpp file on VULMS. Also check your work against the exact assignment file on VULMS, since question wording can vary.
- Download the .cpp file and open it in Dev C++.
- Replace the name and student ID with your own details.
- Compile and run it, and check the output against your own digits.
- Understand the modulus and division extraction before submitting.
- Submit only the .cpp file on VULMS, never a Word document or PDF.
For more study material, you can download course handouts from the VU handouts page and compact revision notes from the VU short notes page. Past papers are also useful for programming practice, and you can find them on the VU midterm past papers page.
Frequently Asked Questions
Is this the complete solution for CS201P Assignment 1 Fall 2026?
Yes. The file is a complete C++ program covering all five steps: student information, digit extraction, the five transactions, the discount, the status classification, and the daily summary. The assignment carries 20 marks and the due date is 6 November 2026.
Can I submit this solution file as it is?
No, not without one change. You must replace the name and the student ID in the program with your own, because the question requires your own details and your own ID produces your own digits and totals. After that change, compile it, check the output, and submit only the .cpp file.
Why must the submission be a .cpp file?
Because the assignment instructions say so explicitly. Assignments submitted in any other format, including images, PDFs, Word documents, rar files, and zip files, are given zero marks. That is why the solution is provided as a .cpp file, ready to open in Dev C++.
Does the program use printf or scanf?
No. The program uses only iostream with cout, and takes no user input anywhere, exactly as the question requires. Using printf or scanf would cost marks, so both are avoided completely.
Last updated: October 2026.



