Answer:
#include <iostream>
#include <stack>
#include <queue>
#include <string>
int main()
{
while ( true )
{
std::string letters;
std::cout << "Please enter a word (Enter - exit): ";
std::getline( std::cin, letters );
if ( letters.empty() ) break;
std::stack<char>
s( std::stack<char>::container_type( letters.begin(), letters.end() ) );
std::queue<char>
q( std::queue<char>::container_type( letters.begin(), letters.end() ) );
while ( !s.empty() && s.top() == q.front() )
{
s.pop();
q.pop();
}
if ( s.empty() ) std::cout << "The word is a palindrome" << std::endl;
else std::cout << "The word is not a palindrome" << std::endl;
}
return 0;
}
Explanation:
A <em>stack</em> is used to replicate a stack data structure in C++ while <em>Queue </em>container is a replica of the queue data structure in C++, Unlike stack, in the queue container, there are two ends, i.e. front, and back.
In the code above to be able to use used stack and queue, we included the headers #include <stack> and#include <queue>.
Answer:
The answer to this question is given below in the explanation section
Explanation:
The correct answer to this question is: it used a more English-like syntax.
The software developer use high-level language to develop or author the program because it is more likely to English syntax and it would be easy for a software developer to author a program easily instead of using low level language and remembering ones and zeros.
Other options are not correct because:
It can be used on computers without microprocessors: Each computer has a microprocessor either you develop a program using high-level or low-level languages. Changes and modifications are easy in high-level language than in low-level languages. so, the option that prevents anyone from making changes to the software later is wrong. However, high-level languages are less complicated in learning and in authoring the programs but it does not use zeros and ones, it uses English-like syntax. So, the last option is also wrong.