Question: Lab 1 2 . String Class and Exception Handling Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Lab String Class and Exception Handling
Name
Score
Compile the following program, find and correct errors.
#include
#include
using namespace std;
int main
Ways to instantiate create a string object
string strGood Morning";
string str "Hot Dog";
string str;
strWorld Cup;
string strFriend str;
cout str is: str endl;
cout str is: str endl;
cout str is: str endl;
cout str is: str endl;
return ;
Complete the following program, and run the program. See pgm pgm
#include
#include
#include
using namespace std;
int main
string str"aaaaaa" ;
int i;
int n intstrlength;
cout "Enter ; assign a character to str
whileisalpha
cout"Please reenter a letter"strati;
cout"The n letters you entered : str
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
