CS201 Assignment 1 Correct Solution Spring 2025
CS201 Assignment 1 Correct Solution Spring 2025
VUAnswer.pk
An assignment submitted in any other format will not be accepted and will receive zero marks. No
excuses will be accepted for submitting a solution file in any other format.
Note: Remember that if you have not used your name and student id in the program your marks will be
deducted.
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
SOLUTION
CODE
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
string name = "VU Answer - 03162965677";
string vuID = "BS123456789";
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
// Extract the middle five digits from the numeric part of VU-ID
string midDigits = numericID.substr(2, 5);
cout << "\nExtracted Middle Five Digits: " << midDigits << "\n";
// Use the extracted middle five digits as quantities for each item
int qBurger = midDigits[0] - '0';
int qPizza = midDigits[1] - '0';
int qFries = midDigits[2] - '0';
int qSandwich = midDigits[3] - '0';
int qDrink = midDigits[4] - '0';
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
const int pFries = 150;
const int pSandwich = 200;
const int pDrink = 100;
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
return 0;
}
OUTPUT SCREENSHOT
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
WhatsApp: +923162965677
MORE SOLUTIONS, HANDOUTS AND PAST PAPERS FREELY VISIT
VUAnswer.pk
REGARD - SARIM
WHATSAPP +923162965677
PLEASE NOTE:
Don't copy-paste the same answer.
Make sure you can make some changes to your solution file before
submitting copy paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an assignment must check your assignment requirement
file.
If you need some help or question about file and solutions feel free to ask.
VUAnswer.pk
WhatsApp: +923162965677