Instructions, answer the blank spaces below by looking into the instructions Fill in the blanks. 0. printf("Hello world

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Instructions, answer the blank spaces below by looking into the instructions Fill in the blanks. 0. printf("Hello world

Post by answerhappygod »

Instructions, answer the blank spaces below by looking into the
instructions
Fill in the blanks.
0. printf("Hello world!\n"); // this is an
example only
1. printf("%s\n", _______ );
2. scanf("%s", _______ );
3. strcpy(_______ , "NinjaGo");
4.
printf("%s\n",_______ );
5. printf("%s\n",_______ );
6. printf("%d\n",_______ );
7. scanf("%s",_______ );
8. scanf("%s",_______ ); ;
9. printf("%d\n", _______ );
10. ptr = _______ ;
11. team_A = _______ ;
12. printf("%p\n",_______ );
13. scanf("%s",_______ );
14. scanf("%s",_______ );
15. printf("%d\n",_______ );
16. printf("%d\n", _______ );
17. scanf("%s", _______ );
18. scanf("%s", _______ );
19. printf("%d\n",_______ );
20. printf("%d\n", _______ );
Instructions
Instructions Answer The Blank Spaces Below By Looking Into The Instructions Fill In The Blanks 0 Printf Hello World 1
Instructions Answer The Blank Spaces Below By Looking Into The Instructions Fill In The Blanks 0 Printf Hello World 1 (123.79 KiB) Viewed 40 times
/*
* e-games.h (this serves as answer to a
previous non-graded exercise on structure declaration)
*
* DO NOT change this file!
*/
typedef char Str20[21];
struct statisticsTag {
int nc; // number of times the player
competed
int nw; // number of times the player won
int now; // number of times the player has been an
overall winner
};
struct playerTag {
Str20 code_name;
// code name of the player
struct statisticsTag player_stat; // statistics
of the player
};
struct teamstatTag {
Str20 opponent_name; // name of the opponent
team
int outcome; // -1
means loss, 0 means tie, 1 means win
};
struct teamTag {
Str20 team_name;
// name of the team
struct playerTag players[3]; // 3 players per
team; player[0] is the 1st player, player[2] is the 3rd/last
player
struct teamstatTag TS[9]; // team
statistics; TS[0] is for the 1st game, TS[8] is for the 9th/last
game
};
Objective: Demonstrate that you can properly access a structure member. Preliminary task: You must first read and understand first the accompanying header file e-games.h which is one of the possible answers to Practice Exercise 3.1. Assume the following variable declarations based on the contents of the header file: struct teamTag team_A; struct teamTag team_B; struct teamTag Teams [10]; // there are 10 teams // Teams [0] is the 1st team, Teams [1] is the 2nd team, // Teams [8] is the 9th team and Teams [9] is the 10th/last team struct teamTag *ptr; Come up with the corresponding C statements for the following. Encode your answer with tight spacing. This means there should not be any unnecessary space in your answer (due to limited Canvas string matching). 0. Print "Hello world!\n" // NOTE: not really part of the problem, this is an example question only 1. Print the team_name of team_A 2. Input the team_name of team_B 3. Copy "NinjaGo" as the team_name of team_A 4. Print the code_name of the 2nd player of team_B 5. Print the opponent_name in the last game of team_A 6. Print the outcome of the 1st game of team_B 7. Input the team_name of the Teams [5] 8. Input the code_name of the 1st player of the Teams [3] 9. Print nw the number of times that the 2nd player of the Teams [7] won 10. Initialize the value of ptr by assigning to it the address of the 1st element of Teams [] array. For numbers 11 to 20: assume that ptr contains the address of Team[0]. 11. Using ptr variable, assign the value of the 3rd element of the Teams [] array to team_A as a structure-to-structure assignment. 12. Using ptr variable, print the address of the array element Teams [9]. For numbers 13 to 16: You must use ptr with a dereference operator*. You must use indexing operator [] with players. 13. Input the team_name of the 3rd team (i.e., Teams [2]) 14. Input the code_name of the 1st player of the 5th team (i.e., Teams [4]) 15. Print nc the number of times that the 2nd player of the 7th team, (i.e., Teams [6]) competed the number of times that the 3rd player of the last team won 16. Print nw For numbers 17 to 20: You must use ptr with a structure pointer operator ->. You must use indexing operator [] with players. 17. Input the team_name of the 3rd team (i.e., Teams [2]) 18. Input the code_name of the 1st player of the 5th team (i.e., Teams [4]) 19. Print nc the number of times that the 2nd player of the 7th team, (i.e., Teams [6]) competed the number of times that the 3rd player of the last team won 20. Print nw
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply