Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a hierarchy chart showing the logical components of your program. Modularize your code according to your chart using the practices learned this week. Your

Create a hierarchy chart showing the logical components of your program. Modularize your code according to your chart using the practices learned this week. Your menu should now call individual modules to do the work of the program. with the following code.

#include

#include

using namespace std;

int main()

{

const int a = 3;

string word[a] = { "apple","ball","cat" };

string nword[a] = { "lppea","lalb","cta" };

string j;

int point;

int p = 0;

int ctr = 0;

int missingLetter, numberFingers, userName;

int favoriteColor, sAnimals1, sshapes2, sMachines3;

cout << "Hi Whats your name? " << endl

cin >> userName >> endl;

// asking childs name?

cout << userName << "Nice to meet you, My name is Raphie";

cout << "BASIC" << endl;

for (int i = 0; i

{

cout << nword[i] << endl;

cin >> j;

ctr++;

if (j == word[i])

{

cout << "==========Congratulation=========" << endl;

cout << "==========You Have Score:" << endl;

cout << " " << i + 1 << " " << "Point" << endl;

// Determining if the correct responce would give the wanted result..

}

else

{

cout << "Wrong" << endl;

}

cout << "Your Score Is:" << "point" << endl;

// Requesting a responce form user to move forward...

cout << userName << "Would you like to talk about" << endl;

cout << " 1 : " << sAnimals1 << endl;

cout << " 2 : " << sshapes2 << endl;

cout << " 3 : " << sMachines3 << endl;

cout << " 4 : Exit Game " << endl;

int choice = 0;

cout << "Your choice: " ;

cin >> choice;

switch (choice)

{

case 1:

cout << "Animals Ok!..." << endl;

break;

case 2:

cout << "Shapes Ok!..." << endl;

break;

case 3:

cout << "Machines Ok!..." << endl;

break;

case 4:

cout << "Exiting Game..." << endl;

break;

}

int mathGame, exitGame;

cout << userName << "would you like to play a Math game ?" << endl;

cout << "1 for Yes or 2 for No" << endl;

cout << " 1 : " << mathGame << endl;

cout << " 2 : " << exitGame << endl;

int choice = 0;

cout << "Your choice: ";

cin >> choice;

switch (choice)

{

case 1:

cout << "Math Ok!..." << endl;

break;

case 2:

cout << "Exit Ok, good by..." << endl;

break;

}

{

char whatsNeeded;

int missingVariblies[3] = {0};

missingLetter[0]= 4;

missingLetter[1]= 5;

missingLetter[2]= 6;

cout << "What is equal to 5" << endl;

cout << "If you already have Two apples how many more do you need" << endl;

cin >> whatsNeeded;

if (3 == whatsNeeded)

{

cout << "the total is" << missingVariblies[2] << "your correct!!!!!" << endl;

}

else

{

cout << "Please try again";

}

}

return 0;

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions