Skip to content
VUBuddy

CS201 Quiz 2 Set 3

Introduction to Programming PDF 60 KBUpdated 23 Oct 2026
Quiz CS201 Quiz 2 Set 3 PDF 60 KB
vubuddy.com
Type
Quiz
Course
CS201 Introduction to Programming
Size
PDF 60 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 60 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2 of 2. Download the file for all 2 pages.

using namespace std; #include<iostream>

int main()

char name[] = {" Dr Asu"}; // Replace with Your First Name char id[] = {" "}; // Replace with Your LMS ID int arrSize = sizeof(name); int lastdigit = 9 ; // Replace with Your LMS id Last digit int j = 1; cout<<" My First Name : "<<name<<endl; cout<<" My VUID : "<<id<<endl; cout<<" Last digit of My VUID :"<<id[10]<<"\n"<<endl;

// For Checking Vowels // Here im using swicth case statement for You Can also Use if else for this purpose

for(int i = 0 ; i <= arrSize ; i++)

switch (name[i])

case 'A':

j++; break; case 'a':

j++; break; case 'E':

j++; break; case 'e':

j++; break; case 'I':

j++; break; case 'i':

j++; break; case 'O':

j++; break; case 'o':

j++; break; j++; break;

j++; break;

default: break;

cout<<"\n\nTotal vowels in my first Name : "<<j-1<<endl; int SumVD = lastdigit + (j-1) ; cout<<" Sum of Vowels in first Name and last digit of VUID : "<< SumVD<<"\n"<<endl;

if (SumVD % 2 == 0 )

for (int y = 1; y <= SumVD; y++)

cout<<" Iteration no : "<<y<<endl; cout<<" My first Name is : "<<name<<endl;

else

for (int z = 1; z <= SumVD; z++)

cout<<" Iteration no : "<<z<<endl; cout<<" My Last Name is : ZaiN "<<endl; // Replace with Your Last Name

return 0;

// I think there is no need to change variable naMes if want to change the identifiers change them carefully.

// After Replacing all values make sure to Remove needless comments.

// If you found any bug in this code feel free to cantact us at :

All CS201 files →
CS201 Introduction to Programming All CS201 handouts, past papers, quizzes and MCQs in one place. Open course page

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.