Solution to For this assignment Write a program in ‘C++’, that uses a Nested Structure to accept … - Sikademy
Author Image

Archangel Macsika

For this assignment Write a program in ‘C++’, that uses a Nested Structure to accept the name of five Players of Chess: Numbers of games played Date of Birth Date of playing first international game Age Status either win or loss Use structures for Date of Birth and International Game in the main structure Chess. struct chess { ------- ------- struct dob { ------ ------ }; struct igame { ------ ------ }; }; When the program runs, it should ask the user to enter data for five Players of Chess.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


using namespace std; /* For this assignment Write a program in ‘C++’, that uses a Nested Structure to accept the name of five Players of Chess: Numbers of games played Date of Birth Date of playing first international game Age Status either win or loss Use structures for Date of Birth and International Game in the main structure Chess. struct chess { ------- ------- struct dob { ------ ------ }; struct igame { ------ ------ }; }; When the program runs, it should ask the user to enter data for five Players of Chess. */ #define NO_OF_PLAYERS 5 #define WIN 1 #define LOOSE 0 #define TIE 2 struct Chess { int No_of_games; }; struct DoB { int day; int month; int year; }; struct IGame { int day; int month; int year; int Status; }; int main() { struct Chess C[NO_OF_PLAYERS]; struct DoB d[NO_OF_PLAYERS]; struct IGame ig[NO_OF_PLAYERS]; int n; for(n=0;n<NO_OF_PLAYERS;n++) { cout<<"\n\tPlayer No. "<<n+1; cout<<"\n\tEnter No. of games played: "; cin>>C[n].No_of_games; cout<<"\n\tEnter DoB Day  : "; cin>>d[n].day; cout<<"\n\tEnter DoB Month: "; cin>>d[n].month; cout<<"\n\tEnter DoB Year : "; cin>>d[n].year; cout<<"\n\tEnter Date of First Internatioinal Game: Day  : "; cin>>ig[n].day; cout<<"\n\tEnter Date of First Internatioinal Game: Month: "; cin>>ig[n].month; cout<<"\n\tEnter Date of First Internatioinal Game: Year : "; cin>>ig[n].year; cout<<"\n\tEnter Status of firts Internationla Game      : "; cin>>ig[n].Status; } return(0); }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1075-qpid-71