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.

CS201 Introduction to Programming Assignment 01 Fall 2021 Solution / Discussion

Views: 766

Replies to This Discussion

CS201 Assignment No.1 Fall 2021 100% Correct Complete Solution By Helping Hands
#cs201 #cs201assignment1correctsolution
cs201 assignment 1 solution 2021

CS201 Assignment No. 1 Fall 2021 100% Correct Complete Solution By Helping hands. CS201 Assignment 1 Complete Correct Solution Solved 2021 || Fall 2021 CS201 Solution Assignment no.1 2021 || Complete Correct Fall 2021 Solved. CS201 Assignment 1 Complete Solution Fall 2021,CS201 Assignment 1 Complete Solution,CS201 Assignment 1,CS201 ,CS201 Assignment 1 solution,CS201 assignment Fall 2021,CS201 assignment solution Fall 2021,CS201 assignment, Assignment 1 CS201 solution, solution CS201 Assignment 1, CS201 Assignment 1 solution 2021,CS201 assignment solution 2021,CS201 Assignment 1,CS201 Assignment 1 solution Fall 2021,CS201 Assignment no 1 solution Fall 2021,CS201 Assignment no 1 solution 2021,CS201 1st assignment solution 2021,CS201 1st assignment solution,CS201 1st assignment solution Fall 2021,assignment solution fall 2021, #CS201 #CS201assignment1solution2021 . CS201 – Introduction to Programming Assignment 01 100% Perfect Solution by Helping hands. In this video provide full solution of assignment 1, CS201 – Introduction to Programming Assignment 1 Solution Fall 2021 Must watch. CS201 Assignment 2021. CS201 Assignment 2021. CS201 Assignment 1 2021.CS201 Assignment 1 Solution Fall 2021. CS201

CS201 Assignment 1 Complete Solution
CS201 Assignment 1 solution
CS201 assignment Fall 2021
CS201 assignment solution Fall 2021
CS201 Assignment 1 solution 2021
CS201 assignment solution 2021
CS201 Assignment 1
CS201 Assignment 1 solution Fall 2021
CS201 Assignment no 1 solution 2021
assignment solution Fall 2021
cs
vu
CS201

CS201 Assignment 1 Solution Fall 2021 | Virtual University 

Assignment No.  1
Semester: Fall 2021

Due Date: 9 Dec 2021

Total Marks: 20

Code Solution:

include #include

using namespace std;

void printnameid(string studentid, string studentname); int calculatelastthreedigits(string studentid);

int main()
{

string studentid=”BC18020431″; // Student id

string studentname=”Muhammad Sarim”; // Student name

printnameid(studentid,studentname);
int TotalLastThreeDigits=calculatelastthreedigits(studentid); int counter=1;
int a,b,c;
// Students id last 3 digits a=4;
b=3; c=1;
cout“”endl;
cout“Sum of Last 3 digits is=”a+b+cendl; cout“”endl;
if ( TotalLastThreeDigits % 2 == 0) // Divide by 2 and see if the reminder is zero? then it is even otherwise it is odd number
{

cout ” Sum is an even value “endl; cout“”endl;

cout“++++++++++++++++++++++++++++++++++++++++++++
“endl;
cout“”endl;
while(counter <= TotalLastThreeDigits)
{

cout ” Iteration: ” counter endl;
cout “My student id is:” studentidendl; counter++;
}
}

else
{

cout ” Sum is an odd value:”endl; while(counter <= TotalLastThreeDigits)
{

cout ” Iteration: “counterendl;
cout “My name is “studentnameendl; counter++;

}
}

return 0;
}

void printnameid(string studentid, string studentname){ cout” My name “studentname endl;
cout” My student id is “studentidendl;

}

int calculatelastthreedigits(string studentid) {

int end=studentid.length(); // Ending point that is total length of string
int start=end-3; // Starting point
string lastthreedigits=studentid.substr(start,end); // Trim the last three digits;
int total=0;

//Calculate the sum of last three digits
for ( int index=0; index < lastthreedigits.length(); index++) { total += lastthreedigits[index] – ‘0’;
}
return total;
}

Code Solution Output :

CS201 Assignment Solution # 1 Fall 2021

CS201 Assignment#01 Fall 2021 Solution 

#CS201
// C201 Assignment No: 1, Fall 2021
//
#include <iostream>
#include <string>
using namespace std;
void printnameid(string studentid, string studentname);
int calculatelastthreedigits(string studentid);
int main()
{
string studentid="bc140201235";
string studentname="Mani Siddiqui";
printnameid(studentid,studentname);
int TotalLastThreeDigits=calculatelastthreedigits(studentid);
int counter=1;
if ( TotalLastThreeDigits % 2 == 0) // Divide by 2 and see if the reminder is zero? then it is even otherwise it is odd number
{
cout "the sum is an even value: \n\n";
cout"++++++++++++++++++++++++++++++++++++++++++++ \n\n";
while(counter <= TotalLastThreeDigits)
{
cout " Iteration: " counter "\n";
cout "My student id is:" studentid "\n";
counter++;
}
}
else
{
cout "the sum is an odd value: \n\n";
while(counter <= TotalLastThreeDigits)
{
cout " Iteration: " counter "\n";
cout "My name is " studentname "\n";
counter++;
}
}
return 0;
}
void printnameid(string studentid, string studentname){
cout"My name is " studentname "\n\n\n";
cout"My student id is:" studentid "\n\n\n";
}
int calculatelastthreedigits(string studentid) {
int end=studentid.length(); // Ending point that is total length of string
int start=end-3; // Starting point
string lastthreedigits=studentid.substr(start,end); // Trim the last three digits;
int total=0;
//Calculate the sum of last three digits
for ( int index=0; index < lastthreedigits.length(); index++) {
total += lastthreedigits[index] - '0';
}
return total; // return the total to calling statement.
}

What will be the solution of practical ? Cs 201

RSS

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

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