JavaScript Assignment

0 comments

Need help in converting pseudo code to javascript. The assignment is fairly easy so it shouldn’t take too much time. I will leave the instructions below along with the assignment pseudo code itself, so it can be converted to javascript.

 

// Declare variables

Declare String player1, player2   // names of the players
Declare Numeric pointGoal           // points needed to win

// Welcome the user

Display “Welcome to the Game of War!”
// Ask for the names of the two players

Display “Enter the first player’s name: “
Input player1
Display “Enter the second player’s name: “
Input player2
// Ask for the point goal

Display “How many points will you play to? “
Input pointGoal

// Display the data

Display “First player: ” + player1
Display “Second player: ” + player2
Display “Game will be played to: ” + pointGoal
// Thank the user

Display “Thank you for playing the game of War!”

 

The Javascript must be well formed.

The Javascript should run and be able to be displayed in an HTML page.

 

I have also attached a text document of code as well.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}