1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vika [28.1K]
3 years ago
9

The goal for me is that I need to identify the objects needed for the UNO card game and the actions that those objects perform,

rather than how the objects are suppose to actually be represented. Write a document that includes an ADT (abstract data type) for each object needed in my program. This is a partial ADT for the UnoCard class.
//get the color of the car
+getColor(): String
//set the color of the card
+setColor(color : String):void
//get the value of the card
+getValue(): int
//set the value of the card
+getValue(val : int): void
//return true if card has same value or
//same color as the card
//return false otherwise
+isMatch(card: UnoCard): boolean
The standard UNO card must be able to report both its color and value, and, when given another card, tell whether or not it is a "match.
Computers and Technology
1 answer:
Alik [6]3 years ago
6 0

Answer:

Explanation:

//Java program

class UnoCard{

  private String color;

  private int value;

 

  public UnoCard(String color , int val) {

      this.color = color;

      value = val;

  }

  public String getColor() {

      return color;

  }

  //set the color of the card

  public void setColor(String color ) {

      this.color = color;

  }

  //get the value of the card

  public int getValue() {

      return value;

  }

  //set the value of the card

  public void setValue(int val) {

      value = val;

  }

  //return true if card has same value or

  //same color as the card

  //return false otherwise

  public boolean isMatch(UnoCard card) {

      return (this.value==card.value)||(this.color==card.color);

  }

}

public class Card {

  public static void main(String args[]) {

      UnoCard card1 = new UnoCard("Red",10);

      UnoCard card2 = new UnoCard("Green",10);

      UnoCard card3 = new UnoCard("Blue",15);

     

      if(card1.isMatch(card2))System.out.println("Match");

      else System.out.println("No Match");

     

      if(card2.isMatch(card3))System.out.println("Match");

      else System.out.println("No Match");

  }

}

You might be interested in
Consider the following class definitions.
Serggg [28]

Answer:

The correct answer is option A

Explanation:

Solution

Recall that:

From the question stated,the following segments of code that should be used in replacing the /* missing code */ so that the value 20 will be printed is given below:

Android a = new Android(x);

a.setServoCount(y);

System.out.println(a.getServoCount());

The right option to be used here is A.

4 0
3 years ago
Which tasks can a user accomplish by using the Find and Replace feature of Word? Check all that apply.
sveticcg [70]

Answer:

B,C,E your welcome

Explanation: i just took the test

3 0
3 years ago
Encoding is the process:
vodomira [7]

Answer:

Of translating an idea or a thought into a code

Explanation:

Encoding is the process of translating an idea or a thought into a code.

For example:

You want a friend to get you a gaming Laptop as a birthday gift, while describing the specification and how the laptop should look like. You visualize a fast laptop in black cover. You tell your friend it is "fast and portable". You translate your perceptions on a particular laptop into words that describe the model.

5 0
3 years ago
¿Por que windows es el sistema operativo más utilizado?
Hatshy [7]

Answer:

Explanation:

Hay muchas razones, para empezar Windows ha estado desde el año 1995. Tuvo muchas actualizaciones y Microsoft (la compañia que lo creo) los sigue actualizando y agregando nuevas funciones. Ademas de eso, Windows es compatible con casi todos los programas que salen. Esto le ayuda a que el usario pueda usar todos los programas que quiera y aumenta la popularidad del sistema operativo. Microsoft tambien trae pre-instalado Windows en todas sus computadoras personales que vende.

3 0
3 years ago
Henry wants to use handheld computers to take customers' orders in her restaurant. He is thinking of using custom written, open
DochEvi [55]

Answer: See explanation

Explanation:

Custom written software refers to the software that's developed for some particular organization or users. It's crates in order to meet the unique requirements of a business.

Since Henry is thinking of using custom written, open source software, then a custom written software will be used. Examples of custom written software will be automated invoicing, bug tracking software, E-commerce software solutions etc.

7 0
2 years ago
Other questions:
  • Comparing tools made of stone, iron, and bronze: place them in the correct order from least to most durable
    14·1 answer
  • The material of this section assumes that search keys are unique. However, only small modifications are needed to allow the tech
    7·1 answer
  • Technician A says that the reserve rating of a battery is the amount of steady current that a fully charged battery can supply f
    6·1 answer
  • This problem has been solved!
    8·1 answer
  • Create a class called Hokeemon that can be used as a template to create magical creatures called Hokeeemons. Hokeemons can be of
    9·1 answer
  • HI How are you anyways are any of you intreseted in my giveaway
    7·2 answers
  • Does the security burden fall primarily on the user? On
    10·1 answer
  • HOW TO DISCONNECT A MONITOR FROM A SYSTEM UNIT
    6·1 answer
  • What is the minimum ethernet frame size that will not be discarded by the receiver as a runt frame?.
    8·1 answer
  • Which scenario is most likely due to an everyday problem rather than a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!