Question: Use the file named assignment 0 5 - start.js ( provided with this assignment ) to get started. This assignment can be completed in three

Use the file named assignment05-start.js (provided with this assignment) to get started. This
assignment can be completed in three stages: Students should complete stage 1 before
proceeding to the 2nd stage, and complete that before stage 3. Take note of the comments in
the provided .js file and follow the suggestions they provide for what to code and where.
STAGE 1- Card
Define a constructor function or class for representing a playing Card. The constructor must
require the following three parameters:
- face eg: "9","10", "Jack"
- value eg: 9,10,10(an ace would get a value of 1)
- suit eg: "Diamond", "Spade", "Club", "Heart"
Include with the Card Object a function called describeSelf() that will return a string description
following this format: "FACE of SUITs. Value: VALUE" eg: "King of Hearts. Value: 10".
Instantiate a single Card object for a King of Hearts (or any card of your choice), invoke the
describeSelf() function on the Card and display the results to the browser.
STAGE 2- Deck
Update the constructor that has already been defined for the Deck class so that it will
instantiate the 52 Card Objects required to populate a Deck. Due to the limitations of function
scope, you may need to use nested for loops (instead of nested forEach() loops) with the
arrays already defined for you. Each new Card Object instantiated should be added to the Deck
variable array named cards using the Array.push() function.
Instantiate a new Deck, shuffle() the cards and run several rounds of the dealCard() then
describeSelf() functions, displaying the results to the web browser each time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!