Examlex

Solved

On Most Systems,you Don't Get a Chance to Enter the Letter

question 26

Essay

On most systems,you don't get a chance to enter the letter when the code given below is run.Write two different code fragments that repair the problem.
cout << "Enter a number:\n";
int number;
cin >> number;
cout << "Enter a letter;\n";
char symbol;
cin.get(symbol);
cout << number << " " << symbol << endl;
Dialog: (Computer output is bolded. )
Enter a number:
21
Now enter a letter:
21
On my system,like many systems,one doesn't get a chance to type the letter.


Definitions:

American Anti-Slavery Society

An abolitionist society founded in 1833 to advocate for the immediate emancipation of all slaves in the United States.

Fanny Wright

Frances Wright was a Scottish-born lecturer, writer, freethinker, feminist, abolitionist, and social reformer, who became a US citizen and played a significant role in the early women's rights and abolition movements.

Haitian Revolution

A successful slave revolt that began in 1791, leading to Haiti's independence from France and the establishment of the first Black republic.

Walden

A book by Henry David Thoreau that reflects upon simple living in natural surroundings, highlighting the importance of self-reliance and individualism.

Related Questions