
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
LOOK AT THE OUTPUT IMAGE CAREFULLY. IT NEEDS TO BE SAME.please make sure you input all details as like the output image.

Transcribed Image Text:Title: Understanding Game Genres and Difficulty Levels
---
**Transcript**
1. **Game: Halo**
- Genre: First-Person Shooter
- Difficulty Level: 6
*Action: Creating a new game*
2. **Game: Splinter Cell**
- Genre: Stealth
- Difficulty Level: 7
*Action: Creating a new game*
3. **Game: Among Us**
- Genre: Survival
- Difficulty Level: 6
*Action: Creating a new game*
---
These are the games you have played this year:
- **Game Name:** Halo
- **Genre:** First-Person Shooter
- **Difficulty Level:** 6
- **Game Name:** Splinter Cell
- **Genre:** Stealth
- **Difficulty Level:** 7
- **Game Name:** Among Us
- **Genre:** Survival
- **Difficulty Level:** 6
*In the Game Destructor*
- Repeat three times: "In the Game destructor"
*Press any key to continue...*
---
This transcript captures the process of selecting and categorizing video games based on their genre and difficulty level. Each game is identified by its name, genre, and difficulty level, showcasing a system for managing and recording gameplay experiences.

Transcribed Image Text:**Programming Task: Creating a Video Game Management Class**
Write a class called `Game` that contains the following attributes for a video game: name, genre, and difficulty level. The class should include a default constructor and destructor. The constructor should output the message: “Creating a new game”, and the destructor should output: “In the Game destructor.” The class should also include appropriate get/set functions.
In the `main()` function, prompt the user to input the number of games they have played in the past year. Create a built-in array dynamically based on this number to hold pointers to `Game` objects.
**Instructions:**
1. **Prompt User for Game Quantity:**
- Ask the user for the number of games played in the last year.
2. **Construct Games:**
- Create a loop in `main()` to handle the number of games specified by the user.
- Within the loop, prompt the user to enter each game's name and genre.
- Use a random number generator to assign a difficulty level between 1 and 10.
- Seed this random number generator with 100.
- Dynamically allocate a `Game` object for each entry using the `new` keyword.
- Use the class’s set functions to store the game's name, genre, and difficulty level.
- Store each `Game*` in the array.
3. **Display Game Information:**
- After constructing and storing all `Game` objects in the array, print the contents.
4. **Memory Deallocation:**
- Ensure that all dynamically allocated memory is de-allocated before the program exits.
**Sample Output:**
```
How many games have you played in the last year?
3
What is the name of a game?
Halo
What is the genre of the Halo game?
First-Person Shooter
Creating a new game
What is the name of a game?
Splinter Cell
What is the genre of the Splinter Cell game?
Stealth
Creating a new game
What is the name of a game?
Among Us
What is the genre of the Among Us game?
Survival
Creating a new game
```
This task emphasizes understanding of dynamic memory allocation, object-oriented programming principles, and input/output operations in a console application.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 4 images

Knowledge Booster
Similar questions
- What is the minimum amount of storage space necessary for a single image?arrow_forwardBuild on our PBM image creator from (code shown below) to create a fully functional image editor (in C++), using 2D arrays to store our changes. To make it more interesting by switching to the Portable Gray Map standard. 8 bit PGM files have color values ranging from 0 (black) to 255 (white), with the values in-between being shades of gray. The header is very similar to PBM, and looks like this: P2 WIDTH HEIGHT 255 IMAGE_DATA The P2 tells image readers that it is a PGM file, and the 255 indicates the largest possible color value is 255. You will first prompt the user to enter a width, height, and initial color value to fill the image. You should then create a 2D array with those dimensions and initialize each cell with that color value. You will then use a loop to create a menu that repeatedly prompts the user to make one of the following choices: Fill in a pixel with a new color ◦ Prompt the user to enter a row and column value and a new color value. If the array has that row and…arrow_forwardHow does one acquire ‘stable’ images from the subcostal windowarrow_forward
- Use this code to run this example attached in the image:arrow_forwardWhat does an animation tag with the lightning bolt represent? Question 12Select one: a. There are multiple animations. b. The animation is very fast. c. A trigger is applied to the animation. d. The animation has a delay.arrow_forwardWhat do we call the individual RGB colors that make up a picture element?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY