Question: For lab 7 , use C + + to work on the file: CS 3 1 1 _ lab 7 _ spring 2 0 2

For lab 7, use C++ to work on the file: CS311_lab7_spring2024.cpp and finish the two questions. I do not know how to throw exceptions or use recursion. Also, assume I don't know how to program. Please explain every step (even things you think I should know).
Question 1: Exception handling
Finish all the TODOs from CS311_lab7_spring2024.cpp.
Questions 2: Recursion
Finish all the TODOs from CS311_lab7_spring2024.cpp.
// CS311MWSpring2024.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include
// TODO: included header files as needed:
// TODO: created a class: AccountLocked.
// Inside this class, override the what() function and
// return the message: "Your account is locked! Contact the admin."
// TODO: before the main function create a function: login(),
// throw the exception: AccountLocked we just created.
// TODO: build a function for reversing a string (loop):
// TODO: Definition of recursive function
int main()
{
// TODO: in the main(), call login(), catch the exception.
// Account Locked
// TODO:use the code to test your question 2 solution:calling reverse function using some strings
std::cout << "Reverse of 'ABCD': "<< reverseString("ABCD")<< std::endl;
std::cout << "Reverse of 'Hello': "<< reverseString("Hello")<< std::endl;
std::cout << "Reverse of 'Bye': "<< reverseString("Bye")<< std::endl;
std::cout << "Reverse of 'ABCD': "<< reverse_string_rec("ABCD")<< std::endl;
std::cout << "Reverse of 'Hello': "<< reverse_string_rec("Hello")<< std::endl;
std::cout << "Reverse of 'Bye': "<< reverse_string_rec("Bye")<< std::endl;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!