Here's the code for game in C++ :
#include <bits/stdc++.h>
using namespace std;
int main()
{
int choice,plus_points=5,minus_points=2,total_points=0;
do{
double d,h,v,theta,t,g=9.81,d1,h1,t1;
cout<<"\nEnter distance (in meters) from the wall: ";
cin>>d;
cout<<"\nEnter height (in meters) of the wall: ";
cin>>h;
cout<<"\nEnter speed (in meters per second) of the
projectile: ";
cin>>v;
cout<<"\nEnter angle (in radians) of the projectile: ";
cin>>theta;
t=2*v*sin(theta)/g;
d1=v*cos(theta)*t;
t1=d/(v*cos(theta));
h1=v*sin(theta)*t1-g*t1*t1/2;
if(d>=d1&&h>=h1){
total_points+=plus_points;
cout<<"\nYayy! Successfully crossed the wall!";
}
else{
total_points-=minus_points;
cout<<"\nSorry! Failed to cross the wall!";
}
cout<<"\nTotal Score is:
"<<total_points<<endl;
cout<<"\nPress 1 to play more...Press 0 to exit...";
cin>>choice;
}while(choice);
return 0;
}
In this project you will implement a very simple TTY game. In this game, the user...
C++ Hangman (game) In this project, you are required to implement a program that can play the hangman game with the user. The hangman game is described in https://en.wikipedia.org/wiki/Hangman_(game) . Your program should support the following functionality: - Randomly select a word from a dictionary -- this dictionary should be stored in an ASCII text file (the format is up to you). The program then provides the information about the number of letters in this word for the user to...
For your Project, you will develop a simple battleship game. Battleship is a guessing game for two players. It is played on four grids. Two grids (one for each player) are used to mark each players' fleets of ships (including battleships). The locations of the fleet (these first two grids) are concealed from the other player so that they do not know the locations of the opponent’s ships. Players alternate turns by ‘firing torpedoes’ at the other player's ships. The...
java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow for managing the question bank. Question bank management will include adding new questions, deleting questions and displaying all of the questions, answers and point values. 2. The project can be a GUI or a menu based command line program. 3. Project details 1. Create a class to...
For your final project you will incorporate all your knowledge of Java that you learned in this class by programming the game of PIG. The game of Pig is a very simple jeopardy dice game in which two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn,...
java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow for managing the question bank. Question bank management will include adding new questions, deleting questions and displaying all of the questions, answers and point values. 2. The project can be a GUI or a menu based command line program. 3. Project details 1. Create a class to...
Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...