CST-105: Exercise 8 - Implementing a Class The following exercise assesses your ability to do the following: Translate a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

CST-105: Exercise 8 - Implementing a Class The following exercise assesses your ability to do the following: Translate a

Post by answerhappygod »

Cst 105 Exercise 8 Implementing A Class The Following Exercise Assesses Your Ability To Do The Following Translate A 1
Cst 105 Exercise 8 Implementing A Class The Following Exercise Assesses Your Ability To Do The Following Translate A 1 (67 KiB) Viewed 71 times
CST-105: Exercise 8 - Implementing a Class The following exercise assesses your ability to do the following: Translate a model into software by implementing a class. • Utilize class objects in a programming solution. 1. Read this document carefully and review the rubric for this assignment before beginning work. Be sure you are familiar with the criteria for successful completion. The rubric link can be found in the digital classroom under the assignment. 2. In this assignment, you are implementing a class from a model shown here. PlayingCard suit : char value int + PlayingCard(s:char, v: int): +getSuit():char +getvalue(): int setSuit(s:char):void + setValue(v: int):void +toString():String + isMatch(p:Playingcard) :boolean PlayingCard ADT 1) The constructor takes 2 char values and initializes the value and suit of the Playing Card. 2) Accessor functions for the suit and value (getters) 3) Mutator functions for the suit and value (setters) 4) A tostring method that displays the PlayingCard in the format (value, suit). For example, a 10 of hearts would display as (10,H). Face cards should display K, Q, 3, or A, for the values 13, 12, 11, 14, respectively. 5) An isMatch method that takes a PlayingCard p as an argument and returns true if p's suit or value match. that of the calling object After writing the class, test each function in a main method before proceeding to the next steps. 3. Once your class is fully tested, write a driver method that does the following: a. Creates an ArrayList of 52 cards b. Fills the deck with standard playing cards c. Randomly selects two cards from the deck and compare the cards to see if they match A sample run can be found at the end of this assignment.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply