Free Essay

Project

In:

Submitted By himo86
Words 5443
Pages 22
American University of Science & Technology
DEPARTMENT OF COMPUTER SCIENCE
CSI 205: Computer Programming I
Fall Term 2014-2015
Ashrafieh Campus
Section B
Prepared by:
Ayham Ballouz (ID#1210302)
Mohamad Deaibes (ID# )
Mohamad Farhat (ID#)
Final Project
Submitted to:
Mr. Joseph Fares

Submission date: Thursday, January 21, 2015 @ 9:30 AM

Problem A [Casino] #include<iostream>#include<iomanip>#include<cstdlib>int rouletteroll();//Function used to roll the roulette.int secretnum();//Function for the secret number in guess the number. int randnum(int);//Function to generate random numbers for the slot machine game.void cointoss(int&);//Function call by reference to toss two coins.using namespace std;int main (){ int summ, bet;//"summ" is the initial sum of the person inputed first and "bet" is the bet in each game. int cost=10;//"cost" is used for some games in order to take from the player the money the game need. enum Status{WIN,LOOSE,CONTINUE}; Status status; char cont='y'; int choice; for(int i=1;i<=32;i++) cout<<"*"; cout<<endl <<"*"<<setw(31)<<"*"<<endl <<"* WELCOME TO OUR 5 STAR CASINO *\n" <<"*"<<setw(31)<<"*"<<endl; for(int j=1;j<=32;j++) cout<<"*"; cout<<endl; cout<<endl; do{ cout<<"PLEASE ENTER YOUR INITIAL SUM OF MONEY($100-$1000): "; cin>>summ; cout<<endl; }while(summ<100||summ>1000); do{ cout<<"IN ORDER TO CONTINUE PLEASE CHOOSE FROM THE FOLLOWING MENU: \n" <<"1.PLAY MINIROULETTE\n" <<"2.PLAY GUESS THE NUMBER($10/round)\n" <<"3.PLAY SLOT MACHINE($10/round)\n" <<"4.PLAY COIN RACE\n" <<"5.EXIT\n" <<"WHAT WILL BE YOUR GAME?: "; cin>>choice; cout<<endl; switch (choice) { case 1: cout<<"MINI-ROULETTE\n"; do{ int num; if(summ<10) { cout<<"Sorry you don't have enough money to continue.\n"; break; } do{ cout<<"Enter your bet($10-$100): "; cin>>bet; cout<<"Enter the number you want to bet on(1-10): "; cin>>num; }while(bet<10&&bet>100||num<1&&num>10); int rnum;//the random number that the roulette generate. rnum=rouletteroll(); if(num==rnum) { summ+=bet; cout<<"\nYOU WIN\n\n"; } else { summ-=bet; cout<<"\nYOU LOOSE\n\n"; } cout<<"Do you wish to play again?(y/n): "; cin>>cont; }while(cont=='y'||cont=='Y'); cout<<"\nYour sum of money is now: "<<summ<<endl; cout<<endl; break; case 2: cout<<"GUESS THE NUMBER\n\n"; do{ int secret, guess, round;//"secret" for the secret number generated. secret=guess=0; round=1; if(summ<10) { cout<<"Sorry you don't have enough money to continue.\n"; break; } secret=secretnum(); summ-=cost; while(guess!=secret&&round<5) { round++; if(guess>secret) cout<<"Too high. Try again.\n"; else cout<<"Too low. Try again.\n"; cout<<"Enter your guess: "; cin>>guess; } if(round<5) { summ+=100; cout<<"Excellent! You guessed the number!\n\n"; } else { cout<<"Sorry! You didn't guessed the number!\n" <<"The number was: "<<secret<<endl<<endl; } cout<<"Do you wish to play again?(y/n): "; cin>>cont; }while(cont=='y'||cont=='Y'); cout<<"\nYour sum of money is now: "<<summ<<endl; cout<<endl; break; case 3: cout<<"SLOT MACHINE\n"; do{ int num, num1, num2, num3; num=num1=num2=num3=0; if(summ<10) { cout<<"Sorry you don't have enough money to continue.\n"; break; } summ-=cost; num1=randnum(num); num2=randnum(num); num3=randnum(num); cout<<num1<<" "<<num2<<" "<<num3<<endl; if(num1==num2&&num1==num3&&num2==num3) { summ+=1000; cout<<"\nYOU WON $1000\n\n"; } else if(num1==num2||num1==num3||num2==num3) { summ+=100; cout<<"\nYOU WON $100\n\n"; } else cout<<"\nYOU LOOSE\n\n"; cout<<"Do you wish to play again?(y/n): "; cin>>cont; }while(cont=='y'||cont=='Y'); cout<<"\nYour sum of money is now: "<<summ<<endl; cout<<endl; break; case 4: do{ cout<<"COIN RACE\n"; if(summ<10) { cout<<"Sorry you don't have enough money to continue.\n"; break; } cointoss (summ); cout<<"Do you wish to play again?(y/n): "; cin>>cont; }while(cont=='y'||cont=='Y'); cout<<"\nYour sum of money is now: "<<summ<<endl; cout<<endl; break; case 5: cout<<"THANK YOU FOR VISITING OUR CASINO\n" <<"HOPE YOU ENJOYED OUR FIVE GAMES.\n" <<"Your final sum of money is: "<<summ<<endl; break; default: cout<<"Invalid entry, press 1,2,3,4, or 5"; break; } }while(choice!=5); system("pause"); return 0;}int rouletteroll(){ int rnum; rnum=rand()%10+1; cout<<"The roulette rolled: "<<rnum<<endl; return rnum;}int secretnum(){ int secret, guess; secret=rand()%1000+1; cout<<"I have a number between 1 and 1000.\n" <<"Can you guess my number?\n" <<"You have only five rounds\n" <<"Please type your guess: "; cin>>guess; return secret;}int randnum(int n){ n=rand()%10; return n;}void cointoss (int& summ){ int c=0, bet=0; do{ cout<<"Enter your bet($10-$100): "; cin>>bet; }while(bet<10&&bet>100); do{ cout<<"Choose the coin you want to bet on(1 for coin 1 and 2 for coin 2): "; cin>>c; }while(c<1||c>2); int coin, coin1, coin2, tail1, tail2; coin=coin1=coin2=tail1=tail2=0; cout<<"Coin 1"<<setw(9)<<"Coin 2"<<endl; while(tail1!=3&&tail2!=3) { coin1=rand()%19+1; if(coin1%2==0) { tail1++; cout<<"Tail"<<setw(9); } else { tail1=0; cout<<"Head"<<setw(9); } coin2=rand()%19+1; if(coin2%2==0) { tail2++; cout<<"Tail"<<endl; } else { tail2=0; cout<<"Head"<<endl; } } if(tail1>=3) coin=1; else coin=2; if(c==coin) { cout<<endl<<"\nYOU WIN\n\n"; summ+=bet; } else { cout<<endl<<"\nYOU LOOSE\n\n"; summ-=bet; }} |

This is a C++ program that simulates the play of Casino:

The object of the Casino is the user to put an initial amount. If the user wins he will gain money and automatically will be gaining. However if he lose then he will lose his money.

Problem B [Bingo] #include<iostream>#include<cstdlib>#include<cstring>#include<ctime>using namespace std;void intro(char[], char[]); //declaring Function Prototypevoid fillstring1(char[]); //declaring Function Prototypevoid fillstring2(char[]); //declaring Function Prototypevoid fillmatrix(int[][5], int, int, char[], char[]); //declaring Function Prototypevoid showmatrix(int[][5], char[], char[]); //declaring Function Prototypevoid inputdata(int[], int, char[], char[]); //declaring Function Prototypevoid check(int[][5], int[], int, int, int, char[], char[]); //declaring Function Prototypeint main(){ srand(time(0)); const int rows = 5;//defines rows const int cols = 5;//defines cols const int size = 5;//defines size char player1[30] = { '\n' };//defines player1 array char player2[30] = { '\n' };//defines player1 array fillstring1(player1);//calls function fillstring1 fillstring2(player2);//calls function fillstring2 intro(player1, player2);//calls function intro int matrix[rows][cols] = { 0 };//defines matrix array int input[size] = { 0 };//defines input array char choice = ' ';//defines choice //Do-While Loop , to repeat as long as the player wants do{ system("cls"); fillmatrix(matrix, rows, cols, player1, player2);//calls function fillmatrix inputdata(input, size, player1, player2);//calls function inputdata showmatrix(matrix, player1, player2);//calls function showmatrix check(matrix, input, rows, cols, size, player1, player2);//calls function check showmatrix(matrix, player1, player2);//calls function showmatrix ... to show the 0's instead of hitten # //End-Program Design cout << "\t \t Thank you " << player1 << " & " <<"\t\t"<< player2 << " for Playing our Bingo Game. " << endl << "\t \t Hope you Liked it!" << endl << "\t \t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " << endl << endl << "\t \t \t This Game was Designed by:" << endl << "\t \t \t --------------------------" << endl << "\t \t \t = Ayham Ballouz" << endl << "\t \t \t = Mohamad Deaibes" << endl << "\t \t \t = Mohamad Farhat" << endl << endl << endl << "\t \t \t Play another round?(Y/N) !!! "; cin >> choice; } while (choice == 'Y' || choice == 'y'); system("pause"); return 0;//return the value 0 to the computer's operating system to signal that the program has completed successfully}// end mainvoid fillstring1(char pl1[]){ cout << "Player 1, kindly enter your FULL NAME (term. by *): "; cin.getline(pl1, 30, '*');}void fillstring2(char pl2[]){ cout << "Player 2, kindly enter your FULL NAME (term. by *): "; cin.getline(pl2, 30, '*');}void intro(char pl1[], char pl2[]){ system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << "We would like to introduce you to the Bingo!" << endl << "-------------------------------------------------------------------" << endl; system("pause"); system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << "Rules" << endl << "-------------------------------------------------------------------" << endl; cout << "1- A bingo ticket is a card with a 5x5 grid." << endl; cout << "2- 5 columns on the card correspond to 5 letters"<<endl << " of the name of the game \"B-I-N-G-O\" ." << endl; cout << "3- To win the game you have to get the BINGO either Horizontal(row) or diagonal." << endl; system("pause"); system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << "Bingo Setup Form" << endl << "-------------------------------------------------------------------" << endl; cout << "The numbers in the columns of a Bingo ticket are selected" << endl << " at random and printed according to the range :" << endl; cout << "\t 1- The numbers in the B column are between 1 and 15." << endl << "\t 2- The numbers in the I column are between 16 and 30." << endl << "\t 3- The numbers in the N column are between 31 and 45." << endl << "\t 4- The numbers in the G column are between 46 and 60." << endl << "\t 5- The numbers in the O column are between 61 and 75." << endl; system("pause"); system("cls");}void fillmatrix(int arr[][5], int r, int c, char pl1[], char pl2[]){ char choice = ' '; cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << pl1 << ", do you wish to fill the Bingo Card " << endl << "randomly or in a specific way?(R/S)" << endl << "-------------------------------------------------------------------" << endl; cin >> choice; system("cls"); if (choice == 'R' || choice == 'r') { system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << pl1 << ", you chose to fill the matrix randomly " << endl << "-------------------------------------------------------------------------" << endl; for (int i = 0; i<r; i++) for (int j = 0; j<c; j++) { switch (j) { case 0: arr[i][j] = rand() % (14) + 1; break; case 1: arr[i][j] = rand() % (14) + 16; break; case 2: arr[i][j] = rand() % (14) + 31; break; case 3: arr[i][j] = rand() % (14) + 46; break; case 4: arr[i][j] = rand() % (14) + 61; break; } } }//end if R if (choice == 'S' || choice == 's') { system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << pl1 << ", you chose to fill the matrix specific way: " << endl << "-------------------------------------------------------------------------" << endl; for (int j = 0; j<c; j++) for (int i = 0; i<r; i++) { if (j == 0) { do{ cout << "Remember for B column the numbers should be between 1 and 15:" << endl; cin >> arr[i][j]; system("cls"); } while (arr[i][j]<1 || arr[i][j]>15); } if (j == 1) { do{ cout << "Remember for I column the numbers should be between 16 and 30:" << endl; cin >> arr[i][j]; system("cls"); } while (arr[i][j]<16 || arr[i][j]>30); } if (j == 2) { do{ cout << "Remember for N column the numbers should be between 31 and 45:" << endl; cin >> arr[i][j]; system("cls"); } while (arr[i][j]<31 || arr[i][j]>45); } if (j == 3) { do{ cout << "Remember for G column the numbers should be between 45 and 60:" << endl; cin >> arr[i][j]; system("cls"); } while (arr[i][j]<45 || arr[i][j]>60); } if (j == 4) { do{ cout << "Remember for O column the numbers should be between 61 and 75:" << endl; cin >> arr[i][j]; system("cls"); } while (arr[i][j]<61 || arr[i][j]>75); } } }}void showmatrix(int arr[5][5], char pl1[], char pl2[]){ system("pause"); system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << "Here is your Bingo Card: " << endl << "--------------------------------------------------------------------------" << endl; cout << "B\tI\tN\tG\tO" << endl; for (int i = 0; i<5; i++) for (int j = 1; j <= 5; j++) { cout << arr[i][j - 1] << "\t"; if (j % 5 == 0) cout << endl; } cout << endl;}void inputdata(int a[], int s, char pl1[], char pl2[]){ system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << pl2 << ", please enter your 5 numbers: " << endl << "--------------------------------------------------------------------------" << endl; for (int i = 0; i<s; i++) cin >> a[i]; system("cls"); cout << "Dear " << pl1 << " & " << pl2 << "," << endl << "Our team welcomes you to play the BINGO GAME!" << endl << endl << "The numbers you have choosen are : " << endl << "--------------------------------------------------------------------------" << endl; for (int i = 0; i<s; i++) cout << " { " << a[i] << " } \t"; cout << endl;}void check(int arr[][5], int a[], int r, int c, int s, char pl1[], char pl2[]){ int n = 0; bool winH = false; bool winV = false; bool wind = true; bool wind2 = true, wind3 = true, wind4 = true; for (int i = 0; i<s; i++) if (arr[i][i] != a[i]) wind = false; for (int i = s - 1; i >= 0; i--) if (arr[i][i] != a[(s - 1) - i]) wind3 = false; for (int i = 0; i<s; i++) if (arr[s - i - 1][i] != a[i]) wind4 = false; for (int i = 0; i<s; i++) if (arr[i][s - i - 1] != a[i]) wind2 = false; for (int i = 0; i<r; i++) { winH = true; for (int j = 0; j<c; j++) if (arr[i][j] != a[j]) { winH = false; break; } if (winH) break; } if (winH) cout << "Good Job " << pl2 << " you hitted a Row!" << endl; else if (wind || wind2 || wind3 || wind4) cout << "Good Job " << pl2 << " you hitted a Diagonal!" << endl; else cout << "Unfortunetly " << pl2 << ", you lose! Try your luck again !" << endl; cout << "After replacing hitten numbers by '0' Here is your Bingo Card:" << endl; for (int i = 0; i<r; i++) for (int j = 0; j<c; j++) for (int k = 0; k<s; k++) { if (a[k] == arr[i][j]) { arr[i][j] = 0; } } system("pause"); system("cls");} |
This is a C++ program that simulates the play of BINGO:
The objective of the game is to complete any row of numbers across the bingo card. The acceptable number arrangements are diagonal, vertical and horizontal lines.

Each player is handed at least one bingo card. In most cases, several cards are issued to a player, often more than twenty. Each card is divided into 5 rows with a total of 25 squares. On the 25 squares are printed numbers between 1 and 75. Each card has a unique number combination.

Problem C [Hotel]

#include<iomanip>#include<iostream>const int F = 5;const int R = 8;bool isfree(int[][R], int, int);//function that check the arrayvcells for room vacancy, if 1 returns false, if 0 returns true/void reserveroom(int[][R], int, int);//funtion to reserver a roomvoid freeroom(int[][R], int, int);//function to free the roomint countfree(int[][R]);//funtion that count free rooms/void showhotel(int[][R]);//funtion that print the hotel formvoid input(int&, int&);//funtion that input the floor and room numberusing namespace std;int main(){ int hotel[F][R] = { 0 };//declaration of the double dimentional array that contain the floor and the room int f, r;//declaration of the floor and the room f = F;//characters that represent the floor r = R;//characters that represent the rooms int choice = 0; { cout << " | " << endl << " _________ " << endl << " | | " << endl << " Welcome | | " << endl << " To the Hotel | | " << endl << " AMOM | | " << endl << " | | " << endl << " | | " << endl << " | | " << endl << " _________ " << endl; system("pause"); system("cls"); } showhotel(hotel);//call the funtion that show the hotel do{ cout << endl << "1-To show if the room chosen is free or not" << endl << "2-To reserve a room " << endl << "3-To free a occupated room" << endl << "4-To count free rooms" << endl << "5- To show the hotel status" << endl << "6-To exit" << endl; cin >> choice; switch (choice) { case 1: input(f, r);//funtion that calls the funtion that input the floor and the rooms if (isfree(hotel, f - 1, r - 1) == true)//call the funtion that check if the room is free cout << "the room " << r << " in floor " << f << " is free" << endl; else cout << "the room " << r << " in floor " << f << " is occupated" << endl; break; case 2: cout << "where do you want to reserve" << endl; input(f, r);//call the funtion that input the floor and the room reserveroom(hotel, f - 1, r - 1); break;//call the funtion that reserve a room case 3: input(f, r);//call the funtion that input the floor and the rooms freeroom(hotel, f - 1, r - 1);//call the funtion that free the room reserved break; case 4: cout << "the number of free rooms is " << countfree(hotel); //call the funtion that count the free rooms break; case 5: showhotel(hotel);//call the funtion that show that show the hotel form break; case 6: cout << "\t \t Thank you for using our system. " << endl << "\t \t Hope you Liked it!" << endl << "\t \t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " << endl << endl << "\t \t \t This was Designed by:" << endl << "\t \t \t --------------------------" << endl << "\t \t \t = Ayham Ballouz" << endl << "\t \t \t = Mohamad Deaibes" << endl << "\t \t \t = Mohamad Farhat" << endl << endl << endl; break; default: cout << "enter number from list " << endl; break; }//end switch } while (choice != 6);//end the do while system("pause"); return 0;//return the value 0 to the computer's operating system to signal that the program has completed successfully}void showhotel(int h[][R]){ int i = 0; cout << " "; while (i<R) { cout << " " << "R0" << i + 1; i++; }//end of while for (int j = 0; j<F; j++) { cout << endl << "F" << j + 1; for (int i = 0; i<R; i++) { cout << " " << "["; if (h[j][i] == 1) cout << "X]"; else cout << " ]"; }//end of the first for loop }//end of the second for loop}//end of funtionvoid input(int& x, int &y){ do{//beginning of the do while to limit the input from 1-->5 cout << "enter the floor number "; cin >> x; } while (x<1 || x>5);//end of do while do{ //beginning of the do while to limit the input from 1-->8 cout << endl << "enter the room number "; cin >> y; } while (y<1 || y>8);//end of do while cout << endl;}//end of the funtion inputbool isfree(int h[][R], int x, int y){ if (h[x][y] == 0) return true; return false;}//end of the funtion isfreevoid reserveroom(int h[][R], int x, int y){ char choice = ' '; if (h[x][y] == 0) { cout << "this room is now reserved "; h[x][y] = 1; }//end of if statement else { cout << "room is already reserved " << endl << "do you want to try to reserve another room ? y/n" << endl; do{ cin >> choice; while (choice != 'y'&&choice != 'Y'&&choice != 'N'&&choice != 'n') { cout << endl; cout << "enter y/n : "; cin >> choice; }//end of the while loop if (choice == 'y' || choice == 'Y') { input(x, y); if (h[x][y] == 0) { cout << "this room has now been reserved "; h[x][y] = 1; choice = 'n'; }//end of if statement else { cout << "this room is reserved already " << endl << "do you want to try another one ? : "; cin >> choice; }//end of else statement }//end of if statement else cout << "come back tomorow" << endl; } while (choice == 'y' || choice == 'Y');//end of the do while loop }//end of the else statement }//end of the funtion reservevoid freeroom(int h[][R], int x, int y){ if (h[x][y] == 1) { h[x][y] = 0; cout << "this room is now empty" << endl; }//end of the if statement else cout << "this room already is empty " << endl;}// end of funtion freeroomint countfree(int h[][R]){ int count = 0; for (int j = 0; j<F; j++) for (int i = 0; i<R; i++) if (h[j][i] == 0) count++; return count;}//end of the function count free |
This is a C++ program that simulates the Hotel.
The aim about this Hotel program is to make reservation for the customer to see if the room is occupied or not and in addition to show the map of the hotel for the rooms.

Problem D [Credit Card] #include<iomanip>#include<iostream>const int F = 5;const int R = 8;bool isfree(int[][R], int, int);//function that check the arrayvcells for room vacancy, if 1 returns false, if 0 returns true/void reserveroom(int[][R], int, int);//funtion to reserver a roomvoid freeroom(int[][R], int, int);//function to free the roomint countfree(int[][R]);//funtion that count free rooms/void showhotel(int[][R]);//funtion that print the hotel formvoid input(int&, int&);//funtion that input the floor and room numberusing namespace std;int main(){ int hotel[F][R] = { 0 };//declaration of the double dimentional array that contain the floor and the room int f, r;//declaration of the floor and the room f = F;//characters that represent the floor r = R;//characters that represent the rooms int choice = 0; { cout << " | " << endl << " _________ " << endl << " | | " << endl << " Welcome | | " << endl << " To the Hotel | | " << endl << " AMOM | | " << endl << " | | " << endl << " | | " << endl << " | | " << endl << " _________ " << endl; system("pause"); system("cls"); } showhotel(hotel);//call the funtion that show the hotel do{ cout << endl << "1-To show if the room chosen is free or not" << endl << "2-To reserve a room " << endl << "3-To free a occupated room" << endl << "4-To count free rooms" << endl << "5- To show the hotel status" << endl << "6-To exit" << endl; cin >> choice; switch (choice) { case 1: input(f, r);//funtion that calls the funtion that input the floor and the rooms if (isfree(hotel, f - 1, r - 1) == true)//call the funtion that check if the room is free cout << "the room " << r << " in floor " << f << " is free" << endl; else cout << "the room " << r << " in floor " << f << " is occupated" << endl; break; case 2: cout << "where do you want to reserve" << endl; input(f, r);//call the funtion that input the floor and the room reserveroom(hotel, f - 1, r - 1); break;//call the funtion that reserve a room case 3: input(f, r);//call the funtion that input the floor and the rooms freeroom(hotel, f - 1, r - 1);//call the funtion that free the room reserved break; case 4: cout << "the number of free rooms is " << countfree(hotel); //call the funtion that count the free rooms break; case 5: showhotel(hotel);//call the funtion that show that show the hotel form break; case 6: cout << "\t \t Thank you for using our system. " << endl << "\t \t Hope you Liked it!" << endl << "\t \t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " << endl << endl << "\t \t \t This was Designed by:" << endl << "\t \t \t --------------------------" << endl << "\t \t \t = Ayham Ballouz" << endl << "\t \t \t = Mohamad Deaibes" << endl << "\t \t \t = Mohamad Farhat" << endl << endl << endl; break; default: cout << "enter number from list " << endl; break; }//end switch } while (choice != 6);//end the do while system("pause"); return 0;//return the value 0 to the computer's operating system to signal that the program has completed successfully}void showhotel(int h[][R]){ int i = 0; cout << " "; while (i<R) { cout << " " << "R0" << i + 1; i++; }//end of while for (int j = 0; j<F; j++) { cout << endl << "F" << j + 1; for (int i = 0; i<R; i++) { cout << " " << "["; if (h[j][i] == 1) cout << "X]"; else cout << " ]"; }//end of the first for loop }//end of the second for loop}//end of funtionvoid input(int& x, int &y){ do{//beginning of the do while to limit the input from 1-->5 cout << "enter the floor number "; cin >> x; } while (x<1 || x>5);//end of do while do{ //beginning of the do while to limit the input from 1-->8 cout << endl << "enter the room number "; cin >> y; } while (y<1 || y>8);//end of do while cout << endl;}//end of the funtion inputbool isfree(int h[][R], int x, int y){ if (h[x][y] == 0) return true; return false;}//end of the funtion isfreevoid reserveroom(int h[][R], int x, int y){ char choice = ' '; if (h[x][y] == 0) { cout << "this room is now reserved "; h[x][y] = 1; }//end of if statement else { cout << "room is already reserved " << endl << "do you want to try to reserve another room ? y/n" << endl; do{ cin >> choice; while (choice != 'y'&&choice != 'Y'&&choice != 'N'&&choice != 'n') { cout << endl; cout << "enter y/n : "; cin >> choice; }//end of the while loop if (choice == 'y' || choice == 'Y') { input(x, y); if (h[x][y] == 0) { cout << "this room has now been reserved "; h[x][y] = 1; choice = 'n'; }//end of if statement else { cout << "this room is reserved already " << endl << "do you want to try another one ? : "; cin >> choice; }//end of else statement }//end of if statement else cout << "come back tomorow" << endl; } while (choice == 'y' || choice == 'Y');//end of the do while loop }//end of the else statement }//end of the funtion reservevoid freeroom(int h[][R], int x, int y){ if (h[x][y] == 1) { h[x][y] = 0; cout << "this room is now empty" << endl; }//end of the if statement else cout << "this room already is empty " << endl;}// end of funtion freeroomint countfree(int h[][R]){ int count = 0; for (int j = 0; j<F; j++) for (int i = 0; i<R; i++) if (h[j][i] == 0) count++; return count;}//end of the function count free |

This project helped us to gain a good new experience that we never had before, it was very nice to work on this project before the finals, knowing that we had to share ideas and mix them up all together to build our programs. Briefly, it was a very good practice for finals, since we had to revise the whole material.

Exercise # | Solved | PercentageCompleted (%) | Grade(for instructor use) | A | Yes | 100 | | B | Yes | 100 | | C | Yes | 10 | | D | Yes | 100 | | Documentation | Yes | 100 | |

--END OF PROJECT-

Similar Documents

Premium Essay

Projects

...Project Estimating Technique Paper By: Efrain Gonzalez Jr. CPMGT/303 October 6, 2014 Chanda Sanders This paper describes each of the project estimating techniques by explaining when each technique would be used, and how each technique is used. The information being explained provides sources of information that is needed to figure out the most appropriate technique for a project. When justifying an estimate there are certain tools you could use that will help one justify an estimate correctly, and the information being provide explains what tools will be used to justify estimates. Project estimating techniques and tools are important aspects needed to achieve the goal and objective of a project. An analogous estimation is a very common estimation technique used to estimate activities within a project through previous experiences with different projects and extrapolates onto the current project at hand. This technique is mainly used for projects that have the same type of work, and the same resources being used between projects. Parametric model estimation is another precise, easy, accurate technique that is used to estimate time, and resources needed within a project to perform activities. The use of this technique is created upon historical experiences, and lessons learned on different projects. The three point estimation techniques is used to clarify and understand levels of uncertainty within an estimation through the use of three sets of assumption that are all different...

Words: 793 - Pages: 4

Premium Essay

Project

...Chapter 3 Planning the Project This chapter begins by discussing the nine key elements of the project plan. The following two sections address the planning process in greater detail with considerable emphasis placed on the project launch meeting and the hierarchical planning process by which parts of the plan are sequentially broken down into finer levels of detail. This provides a natural transition to the creation of the Work Breakdown Structure. Finally, the chapter is concluded with a discussion of multidisciplinary teams including the topics of integration management and concurrent engineering. Cases and Readings Some cases appropriate to the subject of this chapter are: Harvard: 9-692-058 Taco Bell Corp. This 31-page best-selling case describes a project to implement a new strategic plan involving major changes in layout, staffing, quality, product design, and information systems. The coordination and integration of all these project activities is what makes the plan successful, and hard for competitors to imitate. Two teaching notes are available for this case: 5-692-091 (20 pages) and 5-196-073 (12 pages). Harvard: 9-694-059 Hardcard Project: Plus Development Corp. (A1); 9-694-060 Hardcard Project: Plus Development Corp. (A2) This 10-page (12-pages for A2) case allows the students to evaluate, using Microsoft Project software, the time line, resource allocations, and other aspects of a major project concerned with developing a hard disk drive...

Words: 3660 - Pages: 15

Premium Essay

Projects

...THE CONTRIBUTION OF PROJECT MANAGEMENT TO THE DEVELOPMENT OF GHANA INTRODUCTION Project management as a management discipline underpins much economic activity. In industries as diverse as pharmaceuticals, software and aerospace, projects drive business. And in the public sector, it is effective project management that translates politicians' promises of new roads, schools and hospitals into gleaming new constructions that improve everyday life. The development of Ghana Successive Ghanaian governments pursued various models of economic development throughout the 1960s, 70s and 80s. In the immediate post independent era of the early 1960s, Ghana’s economic development objectives were geared towards the ‘Big Push’ primary economic policies. These revolved around: a major investment effort; an industrialization drive; increased import substitution; processing of commodities and minerals previously exported in their raw form; and direct state participation in leading areas of the economy. The 1970s ushered in a policy of increased ‘Ghanaianisation’ or indigenisation with specified industrial activities reserved for state participation, Ghana-foreign ownership, and exclusive Ghana ownership, among others. The early 1980s saw the liberalization of the Ghanaian economy and the encouragement of foreign investments. All these approaches, however, fell far short of expectations and the failures were exacerbated by adverse terms of trade, falling commodity prices, and crippling debt by...

Words: 1230 - Pages: 5

Premium Essay

Project

...State University of New York Empire State College, MBA Program Course 651644: Tools and Processes in Project Management Summer 2013 term Instructor: Dr. Adams Assignment #1: X-philes Data Management Corporation: RFP Matters By Jose M Collazo What is the basis for the problem? There are two primary problems with how X-philes Data Management Corporation handled the request for proposal. The first one was the lack of communication by the managers who selected the same vendor for two different projects. This problem led to the creation of the second problem which is proper resource allocation. When dealing with multiple projects with the same vendor, the company runs the risk of creating multiple interdependencies. Any resource allocation decisions made in one project by the vendor are likely to have ramifications in the other projects. According to Pinto, Some of the better known problems include inefficient use of resources, resource bottlenecks, ripple effects, and the heightened pressure on personnel to multitask (Pinto 2013). The personnel issue in particular, was a main cause of schedule slippage as employees quit at the contractor and they were unable to maintain sufficient staffing levels to keep the projects on track. While bottleneck’s restricts a vendor's ability to make money, they realize that the best way to maximize income is to fully exploit the bottleneck resource (Chakravorty & Atwater§, 2006)...

Words: 1044 - Pages: 5

Premium Essay

Project

...with any project team is a lack of good communication.This type issue could arrise where team members are scareterd all over the world without face to face communication.The communication through the internet, skype or some of the other communication technologies that are now available are sometimes not reliable and could cause miscommunication. what about one of the team members performing one of the tasks without informing the other team members about it. Overdetermining - project managers sometimes overstates their capabilities of comleting a project on time. That is when a project will take say two months to accomplish they use presure or lack of experience or presure to perform even the other factors that ignores reality for something that is not imporsimble to accomples in the time given. When everyone is not available at the same time to work as a team on the project this could cause a delay to finish and deliver the project on time. The trade offs that is to make a clear policy of communication from the begining of the project that nobody goes off course and that everyone have to work as a team and must be on the sameline with everyone on the team. The project head must make him or herself available at all time to make sure that all the policys are met by everyone in the group. Handster inc. 1. Which projects would you recommend Handstar pursue based on the NPV approach? The spreadsheet bellow summarizes the NPV calculations for the six projects assuming...

Words: 518 - Pages: 3

Premium Essay

Projects

...Project Kick-Off Meeting Dwayne A. Blanchette BUS 611: Project Planning and Management Dr.: Donald McKay April 25, 2016 Recently the project charter for transitioning the Quick Drop 100 (QD100) from New York to Florida received final authorization. I was awarded the project and assigned as project manager (PM) to lead a team of qualified individuals and complete the task of relocating the QD100 program to the state of Florida. The next step in the preparation phase is to hold a project kickoff meeting. This meeting will be used to acclimate team members, clients, and other attendants to ensure everyone understands the key players and their respective roles. As the PM I plan to generate enthusiasm, motivation, and excitement while maintaining a guided discussion regarding the content, schedule, and duration of the project from start to finish. To prepare for the meeting I will accomplish several preliminary tasks. The most important areas to consider during preparation include identifying stakeholders, communication methods, team building, accountability and code of conduct. Once the tone has been set and key points discussed the meeting will conclude by first reiterating member expectations and responsibilities followed by a summary of all pertinent information. The bottom line is this kickoff meeting will be presented as such to ensure all relevant attendants and stakeholders are provided a transparent achievable list of goals. Stakeholders A significant...

Words: 1862 - Pages: 8

Premium Essay

Project

...PROJECT MANAGEMENT COURSE ASSESSMENT 1 The final date for submission of this assessment without penalty is 24th March 2014 Assessment will be accepted for marking 14 days prior to the due date Late Penalty System Please refer to the Student/Programme Handbook This module is being delivered through the Manchester Blackboard virtual learning environment. All assessments must be submitted through Blackboard at: http://online.manchester.ac.uk/ If you have any technical difficulties using blackboard, please visit our support pages at: http://www.studentnet.manchester.ac.uk/blackboard Submitting your Assignment 1. Assignments should be typed, 10 or 11 point font size (Times Roman or similar if possible) double spaced with a 4 cm margin on the right side of the page with the page size specified as UK A4. All pages must be numbered. 2. Assignments should be submitted in either Microsoft Office and/or PDF format (.doc, .docx, .pdf etc.). File names should be kept simple and only contain alphanumeric characters (a-z0-9), spaces and underscores (e.g. Valid_filename_1.doc). Files with other characters such as apostrophes, brackets or commas may not be accessible by markers. 3. Assignments may be uploaded only once; substitutions are not permitted and students should therefore ensure that the version uploaded is their final submission. 4. Please ensure you include your student number and the assignment reference (PM/Student Number/Jan14/1) in all submitted assignments and that assignments...

Words: 740 - Pages: 3

Premium Essay

Project

...decision to earn a project management certification is a big one, so make sure you choose one that best fits your current expertise and your future career plans. You can apply for any certification that matches your qualifications, and no certification serves as a prerequisite for another. * Certified Associate in Project Management (CAPM)® * Project Management Professional (PMP)® * Program Management Professional (PgMP)® * PMI Agile Certified Practitioner (PMI-ACP)SM * PMI Risk Management Professional (PMI-RMP)® * PMI Scheduling Professional (PMI-SP)® Already have a PMI certificate PMI Educational Foundation Mission and Vision Join PMI Educational Foundation in Building Better Futures through project Management. PMI Educational Foundation (PMIEF), the philanthropic arm of PMI, announces the Building Better Futures capital campaign to expand its mission to champion project management knowledge and skill for educational and social good globally. Donations to the campaign support sustainable programs that further the very project management principles and practices that project management practitioners, employers and suppliers believe in by developing: * A Better Prepared Project Management Workforce for the Future * A Better Prepared Society for Future Success   * A Better Prepared Response in Future Times of Need Donations to the Building Better Futures campaign demonstrate a clear commitment to bringing the benefits of project management to...

Words: 554 - Pages: 3

Premium Essay

Project

...The Project manager will put together a human resources team that will be responsible for building a cross-cultural team that will work closely together. Individuals who are bilingual and have worked on a global scale will be given priority. Employees will be selected through a thorough interview process that includes background checks and drug testing. We will only hire qualified individual because they will represent the Acme Company in Mexico and will help us establish a relationship with the community we will be serving An approach is to work with a reputable local employment agency, another one is to hire translators to assist management and local staff. The human resources team will implement current company policies and procedures A marketing and communication team will be responsible for: * promoting Acme products * Supporting project management in achieving the aims and objectives of the project. * Implementation and evolution of the brand guidelines. * Instilling and communicating good marketing and communications practice across Acme * Marketing analysis and environmental scanning (the team will ensure that Acme offers competitive prices than local competitors. * Helping the company communicate with the public. * Creating advertisements, campaigning, offering coupons In order to have an effective marketing strategy, we will work with local marketing companies because they have better understanding on how to market Acme’s products...

Words: 319 - Pages: 2

Premium Essay

Project

...Research Project Management Key Concepts Dr Robin Henderson robin@myconsultants.net Research Project Management - Key Concepts © My Consultants Ltd 2010 Introduction The successful management of a research project depends upon the researchers ability to plan, coordinate and perform the research. Many researchers do not formally manage their research and whilst this does not necessarily mean that the research will not be completed successfully this approach has impacts on the staff whom are involved in the project. For example an unplanned approach can often lead to stress in members of the research team, crises management when deadlines are not effectively managed and the lack of time within the research to deliver effective outcomes for all the staff involved in the project. This short document outlines some of the key tools which you can utilise within research contracts to lead to more successful outcomes. Clearly understanding what success means for your project. The starting point for managing a project effectively is to have a clear understanding of what you are trying to achieve. A simple model to start to explore this is to distinguish between outputs and outcomes.  Outputs are the physical deliverables of the project  Outcomes are what happens as a result of the outputs For example in a clinical based trial the output could be a paper with the related outcome being the changes in clinical practise. The starting point for a project is to define what the desired outcomes...

Words: 2908 - Pages: 12

Premium Essay

It Project

...frame: Coalitions composed of varied individuals and interest groups. Conflict and power are key issues Symbolic frame: Symbols and meanings related to events. Culture, language, traditions, and image are all parts of this frame Organization structure: Project organization structure (is hierarchical, but instead of functional managers or vice presidents reporting to the CEO, program managers report to the CEO.) Matrix organization: • represents the middle ground between functional and project structures. Process of Project management: 1. Starts the project 2. Initiate (the planning) 3. Plan 4. Execute 5. Close (end the project) Project management Process Groups: 1 Initiate (start) include defining and authorizing a project or project phase. Initiating processes take place during each phase of a project. 2 Planning (Scope document, schedule management plan, cost mgr plan, and procurement plan) 3 Execute (Implementation phase, acquiring and developing the project team, performing quality assurance, distributing information, managing stakeholder expectations,)building and testing 4 Monitor and control: include regularly measuring and monitoring progress to ensure that the project team...

Words: 323 - Pages: 2

Premium Essay

Project

...Strategy & Project Management: Project orientated organisations Finnland 2005 Prof. (FH) Peter J. Mirski Prof.(FH) Mag. Peter J. Mirski Tel.: +43-512-2070-3510 E-Mail: peter.mirski@mci.edu http://www.mci.edu Current Position MCI, University of Applied Sciences: Director of studies „Management & IT“, Head of IT-Services Academical Profile Research projectmangement, knowledgemanagement strategic information management, e-learning Education process, project, information management Publications and articles in journals Practice Profile Management, R&D Project Management, CEO, CIO Consulting & Training Agenda 10:00 – 14:00 Brief project management overview Project orientated organisations Project scorecard Discussion Literature De Marco T., „The Deadline“, Dorset House Publishing Co ,1997 Goldratt E., “The Critical Chain“, North River Press, 1997 Heerkins G., „project management“, briefcase books 2002 PMBOK Guide, „A Guide to the Project Management Body of Knowledge“, PM Institute, 2000 Links •www.p-m-a.at (pm baseline english, german) •www.pmi.com (pm information) project management overview Importance of Project Management • Projects represent change and allow organizations to effectively introduce new products, new processes, new programs • Project management offers a means for dealing with dramatically reduced product cycle times • Projects are becoming globalised, making them more difficult to manage without a formal methodology –...

Words: 1737 - Pages: 7

Premium Essay

Project

...seek a Project Manager in their Washington DC offices. Provides program support to team members as needed related to projects and program activities. Tasks include task tracking, program change management support, administrative support and project and program reporting. Helps with the preparation of project and program schedules and coordinates the necessary internal and external resources to fulfill the project and program activities within the prescribed time frames and funding parameters to ensure project and program objectives and stakeholders expectations are met. Specific responsibilities include: * Coordinates activities within the project life-cycle including initiation, planning, execution, monitoring and control phases. * * Helps with the preparation of Project and Program Weekly Status report as necessary and upload to the Project Server in a timely fashion. * Generates various other Project, Program and department related status reports as needed. * Helps prepare responses for anticipated questions during the weekly ITIL meeting (in case of a Red project). * Helps Identify and schedules project deliverables, milestones, and required tasks. * Prepares change management documentation in support of the change management process and supports the Change Management meeting. * Documents all change management decisions according to the change management process * Coordinates selection and assignment of SMEs to the project team...

Words: 343 - Pages: 2

Premium Essay

Project

...Project Plan Outline 1.0 Goals and Objectives This section presents a general description of the project along with any general or technical constraints and/or considerations. Please include the sub-sections below. 1. Project name 2. Business goals and project goals 3. Scope 4. Time and budget constraints 5. General and technical requirements 6. Training and documentation 7. Installation 2.0 Project Estimates This section presents a set of estimates for the completion of the project, including people, hardware and software. Please include the following sub-sections. 1. People costs a. Historical or researched data used for estimates (Requires annotation listing where you got this information) b. Salary requirements 2. Equipment costs (Requires costs for all hardware and software used. It is assumed that all hardware and software will be new). a. Hardware b. Software 3. Estimation techniques and results a. Process-based (use the format shown in section 1.2.1 of the lecture) b. Second method c. Triangulation results 3.0 Project Schedule This section presents an overview of project tasks and the output of a project scheduling tool. The following sub-sections should be included: 3.1 Project task list The tasks that have been selected for the project are presented in this section. 3.2 Task network Project tasks and their dependencies are noted in this diagrammatic form. 3.3 Timeline chart A project timeline chart (Gantt chart) is presented...

Words: 508 - Pages: 3

Premium Essay

Projects

...Projects Without Borders Elizabeth Harrin (October 5, 2006) Managing international projects requires much more than calculating that when it’s 9 a.m. in Paris, Texas, it’s 4 p.m. in Paris, France. Crosscultural teams and customers won’t necessarily work the same way as you. Here are some strategies for discovering the differences and dealing with them. As the world gets smaller, projects seem to expand to fill the available space, and now many of us are tackling the challenge of managing cross-cultural project teams and cross-cultural project customers. When your project team spans different countries, getting everyone together for a conference call is a new kind of administrative nightmare. But it’s not just the practicalities of working out time zone disparities and correcting the occasional bit of awkward grammar that make crossborder projects so challenging. National culture plays a big part in how we act and work. Get a group of people together from around the world and they can’t even agree on what noise a rooster makes, so how are they going to come to a conclusion on how to communicate project progress to the stakeholders? Or, to put it another way, the people you are working with won’t necessarily work in the same way as you, and the people you are working for won’t necessarily want the same things. One financial project manager I know was sent to Spain for a year to set up a new process improvement initiative in one of his company’s call centers. The Madridbased office...

Words: 1095 - Pages: 5