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.
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);
}
Comments
Leave a comment