C++ Projects

C++ Projects Inventory

Simulation of Stock Market Trends Gaming Project in C++

Explanation Stock Class: Attributes: name: Name of the stock. price: Current price of the stock. Methods: updatePrice(): Updates the stock price with a random percentage change between -5% and +5%. Ensures the price does not go below zero. printInfo(): Prints the current stock name and price, formatted to two decimal places. Main Function: Random …

Simulation of Stock Market Trends Gaming Project in C++ Read More »

Simulation of Supply Chain Management Gaming Project in C++

Explanation Product Class: Attributes: name: Name of the product. quantity: Quantity of the product. Methods: getInfo(): Prints the product’s name and quantity. adjustQuantity(int amount): Adjusts the quantity by the given amount. hasStock(int amount): Checks if there’s enough stock. Supplier Class: Attributes: name: Name of the supplier. Methods: supply(Product& product, int amount): Supplies products to …

Simulation of Supply Chain Management Gaming Project in C++ Read More »

Simulation of TCP/IP Protocol Gaming Project in C++

Client cpp

Explanation Server (server.cpp): Socket Creation: socket(AF_INET, SOCK_STREAM, 0): Creates a TCP socket. AF_INET: Address family for IPv4. SOCK_STREAM: Specifies a TCP socket. Bind Socket: bind(): Binds the socket to the specified address and port. Listen and Accept: listen(): Marks the socket as passive and ready to accept incoming connections. accept(): Waits …

Simulation of TCP/IP Protocol Gaming Project in C++ Read More »

Simulation of Time Management Gaming Project in C++

Explanation Task Class: Attributes: name: Name of the task. duration: Total duration of the task in seconds. timeLeft: Remaining time for the task. Methods: update(): Reduces the timeLeft by one unit if the task is not complete. isComplete(): Checks if the task is complete. printStatus(): Prints the current status of the task, including time …

Simulation of Time Management Gaming Project in C++ Read More »

Simulation of Traffic Flow Gaming Project in C++

Explanation Constants: ROAD_LENGTH: The length of the road segment. INITIAL_CARS: The number of cars placed on the road initially. CAR_SPEED: The speed at which cars move (in units per time step). SIMULATION_STEPS: Number of steps to simulate. initializeRoad Function: Initializes the road with cars. Places cars at the beginning of the road. printRoad Function: …

Simulation of Traffic Flow Gaming Project in C++ Read More »

Simulation of Traffic Signal Control Gaming Project in C++

Explanation Constants: GREEN_DURATION: The duration of the green light phase in seconds. YELLOW_DURATION: The duration of the yellow light phase in seconds. RED_DURATION: The duration of the red light phase in seconds. simulateTrafficSignal Function: Continuously simulates the traffic signal cycles. Green Light: Prints “Green light” and waits for GREEN_DURATION seconds. Yellow Light: Prints “Yellow …

Simulation of Traffic Signal Control Gaming Project in C++ Read More »

Simulation of Virtual Memory Gaming Project in C++

Explanation Constants: PAGE_SIZE: The maximum number of pages that can be held in memory at a time. NUM_PAGES: Total number of unique pages in virtual memory. VirtualMemory Class: Attributes: pageSize: Maximum capacity of pages in memory. memory: Vector to store pages currently in memory. pageTable: Maps page numbers to their positions in memory for …

Simulation of Virtual Memory Gaming Project in C++ Read More »

Simulation of Virtual Reality (VR) Gaming Project in C++

Explanation Constants: MOVE_SPEED: Defines how much the object moves per key press. printPosition Function: Outputs the current position of the virtual object in 3D space. handleInput Function: Handles user input to move the object. Uses _kbhit() and _getch() from <conio.h> to check for and get keyboard input. Moves the object based on the pressed …

Simulation of Virtual Reality (VR) Gaming Project in C++ Read More »

Simulation of Water Ripple Effect Gaming Project in C++

Explanation Constants: GRID_SIZE: Size of the grid representing the water surface. DAMPING_FACTOR: Factor by which the ripple strength decreases each step. RIPPLE_STRENGTH: Initial strength of the ripple. RIPPLE_RADIUS: Radius of the ripple effect. NUM_STEPS: Number of simulation steps to run. initializeGrid Function: Initializes the grid with all zero values, representing a flat water surface. …

Simulation of Water Ripple Effect Gaming Project in C++ Read More »

Simulation of Weather Patterns Gaming Project in C++

Explanation Constants: INITIAL_TEMPERATURE: Starting temperature in degrees Celsius. TEMPERATURE_VARIATION: Maximum daily variation in temperature. INITIAL_PRECIPITATION: Starting precipitation amount in millimeters. PRECIPITATION_CHANCE: Probability of precipitation occurring on any given day. MAX_PRECIPITATION: Maximum amount of precipitation that can occur in a day. NUM_DAYS: Number of days to simulate. randomDouble Function: Generates a random double between min …

Simulation of Weather Patterns Gaming Project in C++ Read More »

Scroll to Top