Flowcharts of each Programming Task. a. vowelsconsonants b. guessing game c. password #include #include #include #include using namespace std; string response1, response2, response3, response4; int response; (next to this is void vowelsconsonants() then void startingup() the code is in the picture) void guessinggame() { start: startingup(); const int size= 4; srand(time(0)); string pool [size] = {"Motherboard", "CPU", "Monitor", "Graphics Card"}; for (int i = 0; i < size; i++) { int word = rand ()% size; string change = pool[i]; pool[i] = pool[word]; pool[word] = change; } for (int i=0; i<1; i++) { if (pool[i] == "motherboard" || pool[i] == "Motherboard" || pool[i] == "MOTHERBOARD" || pool[i] == "MotherBoard") { cout << "\nGuess: It's a printed circuit board that's built inside a computer's casing." <> response1; if (response1 == "motherboard" || response2 == "Motherboard" || response3 == "MOTHERBOARD" || response4 == "MotherBoard") { cout << "\nThe answer is CORRECT!" << endl; } else { cout << "\nThe answer is INCORRECT!"<< endl; cout << "TRY AGAIN! (PRESS 1)"; cout << ">>>> "; cin >> response; if (response == 1) { goto start; system ("cls"); } else break; } } else if (pool[i] == "cpu" || pool[i] == "CPU" || pool[i] == "Cpu") { cout<< "Guess: The term BRAIN is often used to describe this part of a computer. " << endl; cout << "The Answer is: "; cin >> response2; if (response2 == "cpu" || response2== "CPU" || response2 == "Cpu") { cout << "\nThe answer is CORRECT!" << endl; } else { cout << "\nThe answer is INCORRECT!"<< endl; cout << "TRY AGAIN! (PRESS 1)"; cin >> response; if (response == 1) { system ("cls"); goto start; } else break; } } else if (pool[i] == "monitor" || pool[i]== "Monitor" || pool[i] == "MONITOR") { cout<< "Guess: It is used to show images, text, video, and graphics data generated by a computer that is linked to it." << endl; cout << "The Answer is: "; cin >> response3; if (response3 == "monitor" || response3 == "Monitor" || response3 == "MONITOR") { cout << "\nThe answer is CORRECT!" << endl; } else { cout << "\nThe answer is INCORRECT!"<< endl; cout << "TRY AGAIN! (PRESS 1)"; cin >> response; if (response == 1) { system ("cls"); goto start; } else break; } } else if (pool[i] == "graphics card" || pool[i] == "graphicscard" || pool[i] == "Graphics Card" || pool[i] == "GraphicsCard" || pool[i] == "GRAPHICS CARD" || pool[i] == "GRAPHICSCARD") { cout << "Guess: It is an extension card that generates an image feed for a display device." << endl; cout << "The Answer is: "; cin >> response4; if (response4 == "graphics card" || response4 == "graphicscard" || response4 == "Graphics Card" || response4 == "GraphicsCard" || response4 == "GRAPHICS CARD" || response4 == "GRAPHICSCARD") { cout << "\nThe answer is CORRECT!" << endl; } else { cout << "\nThe answer is INCORRECT!" << endl; cout << "TRY AGAIN! (PRESS 1)"; cin >> response; if (response == 1) { system ("cls"); goto start; } else break; } } } } (next is the 2nd picture the int main)
Flowcharts of each
#include <iostream>
#include <cstring>
#include <ctime>
#include <cstdlib>
using namespace std;
string response1, response2, response3, response4;
int response;
(next to this is void vowelsconsonants() then void startingup() the code is in the picture)
void guessinggame()
{
start:
startingup();
const int size= 4;
srand(time(0));
string pool [size] = {"Motherboard", "CPU", "Monitor", "Graphics Card"};
for (int i = 0; i < size; i++)
{
int word = rand ()% size;
string change = pool[i];
pool[i] = pool[word];
pool[word] = change;
}
for (int i=0; i<1; i++)
{
if (pool[i] == "motherboard" || pool[i] == "Motherboard" || pool[i] == "MOTHERBOARD" || pool[i] == "MotherBoard")
{
cout << "\nGuess: It's a printed circuit board that's built inside a computer's casing." <<endl;
cout << "\nThe Answer is: ";
cin >> response1;
if (response1 == "motherboard" || response2 == "Motherboard" || response3 == "MOTHERBOARD" || response4 == "MotherBoard")
{
cout << "\nThe answer is CORRECT!" << endl;
}
else
{
cout << "\nThe answer is INCORRECT!"<< endl;
cout << "TRY AGAIN! (PRESS 1)";
cout << ">>>> ";
cin >> response;
if (response == 1)
{
goto start;
system ("cls");
}
else
break;
}
}
else if (pool[i] == "cpu" || pool[i] == "CPU" || pool[i] == "Cpu")
{
cout<< "Guess: The term BRAIN is often used to describe this part of a computer. " << endl;
cout << "The Answer is: ";
cin >> response2;
if (response2 == "cpu" || response2== "CPU" || response2 == "Cpu")
{
cout << "\nThe answer is CORRECT!" << endl;
}
else
{
cout << "\nThe answer is INCORRECT!"<< endl;
cout << "TRY AGAIN! (PRESS 1)";
cin >> response;
if (response == 1)
{
system ("cls");
goto start;
}
else
break;
}
}
else if (pool[i] == "monitor" || pool[i]== "Monitor" || pool[i] == "MONITOR")
{
cout<< "Guess: It is used to show images, text, video, and graphics data generated by a computer that is linked to it." << endl;
cout << "The Answer is: ";
cin >> response3;
if (response3 == "monitor" || response3 == "Monitor" || response3 == "MONITOR")
{
cout << "\nThe answer is CORRECT!" << endl;
}
else
{
cout << "\nThe answer is INCORRECT!"<< endl;
cout << "TRY AGAIN! (PRESS 1)";
cin >> response;
if (response == 1)
{
system ("cls");
goto start;
}
else
break;
}
}
else if (pool[i] == "graphics card" || pool[i] == "graphicscard" || pool[i] == "Graphics Card" || pool[i] == "GraphicsCard" || pool[i] == "GRAPHICS CARD" || pool[i] == "GRAPHICSCARD")
{
cout << "Guess: It is an extension card that generates an image feed for a display device." << endl;
cout << "The Answer is: ";
cin >> response4;
if (response4 == "graphics card" || response4 == "graphicscard" || response4 == "Graphics Card" || response4 == "GraphicsCard" || response4 == "GRAPHICS CARD" || response4 == "GRAPHICSCARD")
{
cout << "\nThe answer is CORRECT!" << endl;
}
else
{
cout << "\nThe answer is INCORRECT!" << endl;
cout << "TRY AGAIN! (PRESS 1)";
cin >> response;
if (response == 1)
{
system ("cls");
goto start;
}
else
break;
}
}
}
}
(next is the 2nd picture the int main)
Step by step
Solved in 4 steps with 5 images