Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ necessary, create a new project named Advanced34 Project and save it in the

ID: 3729109 • Letter: C

Question

C++

necessary, create a new project named Advanced34 Project and save it in the Cpp8 Chap13 folder. Also create a new source file named Advanced34 cpp. Create a program that allows the user to enter a password. The program should then create and display a new password using the rules listed in Figure 13-36. Use a sentinel value to end the program. 34. If 1. All vowels (A, E. IL 0, and U) in the original password should be replaced with the letter X I of the characters in the original password should be reversed.

Explanation / Answer

//Advanced34.cpp

#include <iostream>
#include<string>
#include<cstring>
using namespace std;

int main()
{
string pass,newpass;
int len,i=0;
cout<<"Enter Password:";
cin>>pass;
newpass=pass;
  
while(pass[i]!='')
{
i++; // find legnth of string
}
len=i;
  
  
  
for(int i=0;i<len;i++)
{
if(pass[i]=='A'|pass[i]=='E'|pass[i]=='I'|pass[i]=='O'|pass[i]=='U')   
{
newpass[i]='X'; // replace vovel with 'X'
}
if(isdigit(newpass[i]))
{
newpass[i]='Z'; //replace digit with 'Z'
}
}
  
  
  
for(i=0;i<len/2;i++)
{
char temp=newpass[len-i-1]; // logic for reverse the string
newpass[len-i-1]=newpass[i];
newpass[i]=temp;
}
cout<<"New Password is:"<<newpass;
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote