- Type
- Quiz
- Course
- CS201 Introduction to Programming
- Size
- PDF 60 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
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 :
Related CS201 files
All CS201 files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.