Waived!

This is it the big night Everything comes together here Variables TrickOrTreater

(4 customer reviews)

Original price was: $10.00.Current price is: $5.00.

Download button will appear immediately after successful payment.

Full support will be provided with necessary files installation.

Get impeccable customized solution within 24 hours, hassle-free.

View Details
SKU: 4825 Category: Tags: , , , , , , , , , , , , , , , , , , ,
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download

Description

This is it, the big night! Everything comes together here.

Variables:

– TrickOrTreater[] cryptKickerFive – array of length 5

– TrickOrTreater[] ghoulGang – array of length 5

Constructors:

– A constructor that takes in arrays for cryptKickerFive and ghoulGang (in this order).

– You may assume that each input array is not null, and that neither array has null entries. Further, you may assume that each input array is of the expected length. You may shallow copy these arrays.

Note: Even though this assignment guarantees each team will have five trick-or-treaters, do not hardcode the literal value 5 throughout this class. Write your code so that it would accommodate any pair of positive length arrays that share a length.

Methods:

– toString: To get a basic idea for the matchup, format a String representing HalloweenNight to this specification (no leading nor trailing whitespace, no angle brackets, no quotation marks, a single space following each colon and comma, and a single space preceding and following “versus”): versus ghoulGang: , , , , “

– Use the String representations defined for each trick-or-treater.

– Note: CKF represents the cryptKickerFive and GG represents the ghoulGang. The digit following the initials represents the index in the corresponding array.

– Note: It is acceptable to hardcode your format string to anticipate five members on each team for this method.

– compareTeams: Trick-or-treaters in each group could be off to a head start. Minding that, this method establishes rough criteria for which team begins at an advantage. Compare trick-or-treaters at matching indices of both teams (e.g., 0 and 0 ). The team with a higher count of greater trick-or-treaters is at an advantage. Print out the appropriate string based upon the conclusion followed by a newline:

– “cryptKickerFive is favored.”

– “ghoulGang is favored.”

– “Neither team is favored.”

– battle: This method takes in a positive int representing the winning candy threshold. A team’s total candy count must be at least this amount to win. If the input is nonpositive, default to 60. The instructions below describe the actions that a team should perform in one “turn”. Each trick-or-treater on the team will trick-or-treat. Following trick-or-treating, each ghost on the team will attempt to rob the trick-or-treater at the same index (e.g., 0 and 0) of the other team. Hint: Think of an operator that checks if a given reference has an “is-a” relationship with a class or interface. Although this HW defines only two specific kinds of trick-or-treaters, design your code to hold up even if there were more than two kinds. The battle should begin with the cryptKickerFive taking a turn. Each team must take at least one turn. The first team to meet the winning candy threshold after both teams take an equal number of turns wins. If both teams meet this threshold, they tie. Print out the appropriate string based upon the results followed by a newline:

– “cryptKickerFive won!”

– “ghoulGang won!”

– “It is a tie!”


4 reviews for This is it the big night Everything comes together here Variables TrickOrTreater

  1. Gary Spinell

    It was quality work and in a timely manner. It was the help I needed at the time, and I appreciate it so very much.

  2. Raheel Rahman

    great and amazing work, highly recommend. God bless you in all your days 🙂

  3. David Updike

    Excellent job, my friend. Thank You!!

  4. Karina Cisneros

    I really love the quality of the assignments. They are great so far. Accurate.

Only logged in customers who have purchased this product may leave a review.


You may also like…

Patron Details

Additional information

Your Solution

Product
Quantity
Total
Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.