Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C + + Help Need help with main.cpp Instructions: Write a program that reads a line of text, changes each uppercase letter to lowercase, and
C Help Need help with main.cpp
Instructions: Write a program that reads a line of text, changes each uppercase letter to lowercase, and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome a set of letters or numbers that is the same whether read forward or backward
If the input text is a palindrome, the program should print The line of text you entered is a palindrome.
If the input text is not a palindrome, the program should print The line of text you entered is not a palindrome.
my main.cpp
#include
#include
#include
#include
using namespace std;
int main
stack stk;
queue que;
cout "Enter a line of text: ;
string line;
getlinecin line;
for char c : line
c tolowerc;
stkpushc;
que.pushc;
bool isPalindrome true;
while stkempty && que.empty
if stktop que.front
isPalindrome false;
break;
stkpop;
que.pop;
if isPalindrome
cout "The line of text you entered is a palindrome." endl;
else
cout "The line of text you entered is not a palindrome." endl;
return ;
My problem is in the rubric:
Status: FAILED!
Check:
Test: Variable of type stackType is declared in maincpp
Reason: Unable to find stackTypes in the program.
Error : str AssertionError
Status: FAILED!
Check:
Test: Variable of type queueType is declared in maincpp
Reason: Unable to find queueTypes in the program.
Error : str AssertionError
Status: FAILED!
Check:
Test: Method addQueue called to add item to queue
Reason: Unable to find saddQueues in the program.
Error : str AssertionError
Status: PASSED!
Check:
Test: Method front is used to get item from front of queue
Reason: sfronts was found in the program.None
Status: FAILED!
Check:
Test: Method deleteQueue is called to remove from front of queue
Reason: Unable to find sdeleteQueues in the program.
Error : str AssertionError
I have myStack.h queueADT.h queueAsArray.h and stackADT.h
I could put them here but they will be too long.
Please take your time and check to see if its runnable pls
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started