Question
An intern is writing an ADT for a data object that represents throwing dice. The intent is to be very general as it will be
An intern is writing an ADT for a data object that represents throwing dice. The intent is to be very general as it will be incorporated into a variety of games which use any kind of dice (size/shape/color). They have asked you to critique their initial design, given below. Which of the following comments would you make? Incorrect responses will be penalized.
ADT Dice
Data
Count //integer number of dice tossed, Sum //integer total of the toss, total roll ranges from 1N to 6N Dielist //of toss, values of a toss range from 1 to 6
Methods
Toss Process: Toss dice and compute sum Postcondition: sum contains sum of dice on toss and the list identifies the value of each die tossed Output: None DieTotal Process: retrieve the variable Sum which specifies the total for most recent toss Postcondition:The dice are unchanged Output: Total of dice for most recent toss DisplayToss Process: print the list of dice values for the most recent toss Postcondition: the dice are unchanged Output: None End ADT Dice
Group of answer choices
A You suggest a method to change the color of the dice
B There is nothing to initialize the dice.
C In this style of specifying the ADTs, we do not need to specify the Input or the Precondition since it is always "None".
D You suggest a method to change the numbers of sides on the dice.
E You think the ADT should specify the implementation of the list in the data section.
F There are no other reasonable methods to suggest.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started