Posts

C++ Snake and Ladder Game Project Source Code

C++ Snake and Ladder Game Project Source Code #include<iostream.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<time.h> void draw_line(int n,char ch); void board(); void gamescore(char name1[],char name2[],int p1, int p2); void play_dice(int &score); void main() { int player1=0,player2=0,lastposition; char player1name[80],player2name[80]; clrscr(); randomize(); draw_line(50,'='); cout<<"\n\n\n\n\t\tSNAKE LADDER GAME\n\n\n\n"; draw_line(50,'='); cout<<"\n\n\nEnter Name of player 1 :"; gets(player1name); cout<<"\n\n\Enter Name of player 2 :"; gets(player2name); while(player1<=100 && player2<=100) { board(); gamescore(player1name,player2name,player1,player2); cout<<"\n\n--->" <<player1name<<" Now your Turn >> Press any key to play "; getch(); lastposition=player1; play_dice(player1); if(player1<lastposit...

Casino Game : Number Guessing Program

Casino Game : Number Guessing Program #include <iostream> #include <string> // Needed to use strings #include <cstdlib> // Needed to use random numbers #include <ctime> using namespace std ; void drawLine ( int n , char symbol ); void rules (); int main () { string playerName ; int amount ; // hold player's balance amount int bettingAmount ; int guess ; int dice ; // hold computer generated number char choice ; srand ( time ( 0 )); // "Seed" the random generator drawLine ( 60 , '_' ); cout << "\n\n\n\t\tCASINO GAME\n\n\n\n" ; drawLine ( 60 , '_' ); cout << "\n\nEnter Your Name : " ; getline ( cin , playerName ); cout << "\n\nEnter Deposit amount to play game : $" ; cin >> amount ; do { system ( "cls" ); rules (); cout ...

C++ Super Market Billing Project Source Code

C++ Super Market Billing Project Source Code #include<conio.h> #include<stdio.h> #include<process.h> #include<fstream.h> //*************************************************************** // CLASS USED IN PROJECT //**************************************************************** class product { int pno; char name[50]; float price,qty,tax,dis; public: void create_product() { cout<<"\nPlease Enter The Product No. of The Product "; cin>>pno; cout<<"\n\nPlease Enter The Name of The Product "; gets(name); cout<<"\nPlease Enter The Price of The Product "; cin>>price; cout<<"\nPlease Enter The Discount (%) "; cin>>dis; } void show_product() { cout<<"\nThe Product No. of The Product : "<<pno; cout<<"\nThe Name of The Product : "; puts(name); cout<<"\nThe Price of The Product : "<<price; cout<<"\nDiscount : ...

C++ HANGMAN GAME PROJECT - source code of program

C++ HANGMAN GAME PROJECT - source code of program #include <iostream.h> #include <stdlib.h> #include <string.h> #include <conio.h> const int MAXLENGTH = 80 ; const int MAX_TRIES = 5 ; const int MAXROW = 7 ; int letterFill ( char , char [], char []); void initUnknown ( char [], char []); int main () { char unknown [ MAXLENGTH ]; char letter ; int num_of_wrong_guesses = 0 ; char word [ MAXLENGTH ]; char words [][ MAXLENGTH ] = { "india" , "pakistan" , "nepal" , "malaysia" , "philippines" , "australia" , "iran" , "ethiopia" , "oman" , "indonesia" }; //choose and copy a word from array of words randomly randomize (); int n = random ( 10 ); strcpy ( word , words [ n ]); // Initialize the secret word with the * character. initUnknown ( word , unknown ); // welcome the user ...
Student Report Card System - source code of program #include<fstream.h> #include<iomanip.h> #include<stdio.h> #include<conio.h> //*************************************************************** // CLASS USED IN PROJECT //**************************************************************** class student { int rollno ; char name [ 50 ]; int p_marks , c_marks , m_marks , e_marks , cs_marks ; float per ; char grade ; void calculate (); //function to calculate grade public : void getdata (); //function to accept data from user void showdata (); //function to show data on screen void show_tabular (); int retrollno (); }; //class ends here void student :: calculate () { per =( p_marks + c_marks + m_marks + e_marks + cs_marks )/ 5.0 ; if ( per >= 60 ) grade = 'A' ; else if ( per >= 50 ) grade = 'B' ; else if ( per >= 33 ) grade = 'C' ; else grade = '...