SUPERMARKET BILLING SYSTEM
21CSC101T/OBJECT ORIENTED DESIGN AND
PROGRAMMING
PROJECT REPORT
Submitted by
SANTHRU MOHAN.A RA2211030020135
SATHYASUMAN.M RA2211030020141
MADHAN.M RA2211030020181
Under the guidance of
Dr. S. DEEPA
(Assistant Professor, Department of Computer Science
and Engineering)
II SEMESTER/I YEAR
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
RAMAPURAM, CHENNAI
APRIL 2024
1
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Deemed to be University U/S 3 of UGC Act, 1956)
BONAFIDE CERTIFICATE
Certified that this project report titled SUPERMARKET BILLING SYSTEM is
the bonafide work of SANTHRU MOHAN (RA2211030020135),
SATHYASUMAN and (RA2211030020141), MADHAN (RA2211030020181),
who carried out the project work under my supervision. This project work confirms
to 21CSC101T /Object Oriented Design and Programmig, II Semester, I year, 2024.
SIGNATURE
Dr.S.DEEPA, M. Tech, Ph.D.,
Assistant Professor
Computer Science and Engineering,
SRM Institute of Science and Technology,
Ramapuram, Chennai.
2
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY
RAMAPURAM, CHENNAI
DECLARATION
We hereby declare that the entire work contained in this project report titled
“SUPERMARKET BILLING SYSTEM” has been carried out by SANTHRU
MOHAN (REG NO: RA2211030020135), SATHYASUMAN (REG NO: RA2211030020141),
MADHAN (REG NO: RA2211030020181) at SRM Institute of Science and Technology,
Ramapuram, Chennai, under the guidance of Dr. S. DEEPA, Assistant professor,
Department of Computer Science and Engineering.
Place: Chennai MADHAN
Date: SATHYASUMAN
SANTHRU MOHAN
3
ABSTRACT
1.INTRODUCTION
This program implements the classic game of Rock Paper Scissors. It
allows users to play against the computer and demonstrates basic game
logic.
2. PROBLEM STATEMENT
Create a C++ program to simulate the game of Rock Paper Scissors.
3. OBJECTIVE
The objective is to provide an interactive game experience where the
user can play against the computer and learn basic programming
concepts.
4. SCOPE OF THE PROJECT
- Implement a menu for user interaction.
- Develop game logic to determine the winner.
- Handle user input and display appropriate messages.
5. EXISTING SYSTEM
4
The program can be executed on any system with a C++ compiler
installed.
6. PROPOSED SYSTEM
The purpose of the system is to provide entertainment and serve as a
learning tool for programming beginners.
6.1 MODULES DESCRIPTION
- Player model: Represents the user's choice (rock, paper, or scissors).
- Computer model: Represents the computer's randomly generated
choice.
- Game model: Implements the game logic and determines the winner.
The program prompts the user to choose between rock, paper, or
scissors. It generates a random choice for the computer and compares
the choices to determine the winner. The result is displayed to the user
along with an option to play again.
7. UML DIAGRAMS
[Player] <---- [Game] ----> [Computer]
8. IMPLEMENTATION & CODING
#include <iostream>
#include <cstdlib>
#include <ctime>
enum class Choice { ROCK, PAPER, SCISSORS };
5
class Game {
public:
Choice getUserChoice() {
int choice;
std::cout << "Enter your choice (0 for Rock, 1 for Paper, 2 for Scissors): ";
std::cin >> choice;
return static_cast<Choice>(choice);
}
Choice getComputerChoice() {
return static_cast<Choice>(rand() % 3);
}
void determineWinner(Choice userChoice, Choice computerChoice) {
if (userChoice == computerChoice) {
std::cout << "It's a tie!\n";
} else if ((userChoice == Choice::ROCK && computerChoice ==
Choice::SCISSORS) ||
(userChoice == Choice::PAPER && computerChoice ==
Choice::ROCK) ||
(userChoice ==
Choice::SCISSORS && computerChoice == Choice::PAPER)) {
std::cout << "You win!\n";
} else {
std::cout << "Computer wins!\n";
}
}
};
6
int main() {
srand(time(0));
Game game;
char playAgain = 'y';
while (playAgain == 'y' || playAgain == 'Y') {
Choice userChoice = game.getUserChoice();
Choice computerChoice = game.getComputerChoice();
std::cout << "You chose ";
switch (userChoice) {
case Choice::ROCK:
std::cout << "Rock.\n";
break;
case Choice::PAPER:
std::cout << "Paper.\n";
break;
case
Choice::SCISSORS:
std::cout << "Scissors.\n";
break;
}
game.determineWinner(userChoice, computerChoice);
std::cout << "Do you want to play again? (y/n): ";
std::cin >> playAgain;
}
7
return 0;
}
9. SCREENSHOTS
10. CONCLUSION
This program successfully implements the game of Rock Paper Scissors in C++. It
provides an engaging user experience and demonstrates fundamental programming
concepts such as user input, random number generation, and
conditional statements.