Create a class named Tile that represents Scrabble tiles. The instance variables should include a String named letter and an integer named value. Write a constructor that takes parameters named letter and value and initializes the instance variables. Write a method named printTile that takes a Tile object as a parameter and displays the instance variables (letter and value) in a reader-friendly format. Using a Driver class create a Tile object with the letter Z and the value 10, and then uses printTile to display the state of the object. Create getters and setters for each of the attributes.

Answers

Answer 1

Answer:

Here is the Tile class:

class Tile {   //class name  

// declare private data members of Tile class

  private int value;  //int type variable to hold the integer

  private String letter;     //String type variable to hold the letter

  public void setValue(int value){  //mutator method to set the integer value

       this.value = value;    }

   public void setLetter(String letter){   //mutator method to set the letter

       this.letter = letter;    }

   public int getValue()   //accessor method to access or get the value

     {return value;}  //returns the current integer value

   

   public String getLetter()   //accessor method to access or get the letter

      {return letter;}     //returns the current string value

   

   public Tile(String letter, int value){   //constructor that takes parameters named letter and value

     setValue(value);  //uses setValue method to set the value of value field

     setLetter(letter);   }  }  //uses setValue method to set the value of letter field

/* you can also use the following two statements inside constructor to initializes the variables:

this.letter = letter;

this.value = value; */

Explanation:

Here is the driver class named Main:

public class Main{  //class name

public static void main(String[] args) { //start of main method  

           Tile tile = new Tile("Z", 10); //creates object of Tile class named tile and calls Tile constructor to initialize the instance variables  

       printTile(tile); } //calls printTile method by passing Tile object as a parameter

public static void printTile(Tile tile) { //method to displays the instance variables (letter and value) in a reader-friendly format

 System.out.println("The tile " + tile.getLetter() + " has the score of " + tile.getValue()); }  } //displays the string letter and integer value using getLetter() method to get the letter and getValue method to get the value

The screenshot of the output is attached.

Create A Class Named Tile That Represents Scrabble Tiles. The Instance Variables Should Include A String

Related Questions

reading is important blank areas of life A in very few B in many C only in academic D only in career​

Answers

Answer:

The answer is B. I'm pretty sure It is

Explanation:

I just took the quiz and it was right  

What is a special type of variable used in subroutines that refers to a piece of data?

Answers

Answer: A parameter or a formal argument is used

Which of the following ports offers a fast connection that could be used to download and watch your favorite TV shows?

Ethernet

modem

FireWire

USB

Answers

Answer

The Answer Would Be FireWire and the next one would be USB

Explanation:

FireWire offers a fast connection that could be used to download and watch your favorite TV shows.

What is FireWire and how it is related to connection?

FireWire is a computer interface employed for high-speed communication (i.e., connection) and transference of data.

Apple described this interface using the name of FireWire.

This interface (FireWire) can be used to connect different classes of electronic tools (e.g., printer, scanner, video, etc)

In conclusion, FireWire offers a fast connection that could be used to download and watch your favorite TV shows.

Learn more about FireWire here:

https://brainly.com/question/1590202

What is an instance of a computer program that is being executed?
1. Processing
2. Storage
3. Input
4. App

Answers

It is processing because it is processing the data on the program.

what is the full from of cpu​

Answers

Explanation:

[tex]\blue{ central ~proccecing ~unit }[/tex] ⠀


Which function will add a name to a list of baseball players in Python?

append()
main()
print()
sort()

Answers

Answer: B I took the test

Explanation:

The function that will add a name to a list of baseball players in Python is main(). The correct option is b.

What is python?

Python is a popular computer programming language used to create software and websites, automate processes, and analyze data. Python is a general-purpose language, which means it may be used to make many various types of applications and isn't tailored for any particular issues.

A function is a section of code that only executes when called. You can supply parameters—data—to a function. The main() function in Python serves as the point at which any software application is executed.

Since the program only runs when it is executed directly, and not if it is imported as a module, the execution of the program can only begin when the main() function is declared in Python.

Therefore, the correct option is b, main().

To learn more about python, refer to the link:

https://brainly.com/question/28966371

#SPJ2

Does anyone use the trinket.io to code (if so I need help)

Answers

Answer:

No sorry

Explanation:

• Open your Netbeans IDE and answer the following question
• Create a folder on the desktop. Rename it with your student name and student number
• Save your work in the folder you created.
At a certain store they sell blank CDs with the following discounts:
* 10% for 120 or more
* 5% for 50 or more
* 1% for 15 or more
* no discount for 14 or less
Write a program that asks for a number of discs bought and outputs the correct discount. Use either a switch statement or if..elseif.. ladder statements. Assuming that each blank disk costs N$3.50. The program should then calculate the total amount paid by the buyer for the discs bought.

Answers

Answer:

public static void main(String[] args)

   {

       int cdCount;

       double cdCountAfterDiscount;

       DecimalFormat df = new DecimalFormat("$##.##"); // Create a Decimal Formatter for price after discount

       System.out.println("Enter the amount of CD's bought");

       Scanner cdInput = new Scanner(System.in);  // Create a Scanner object

       cdCount = Integer.parseInt(cdInput.nextLine());  // Read user input

       System.out.println("CD Count is: " + cdCount);  // Output user input

       if(cdCount <= 14 )

       {

           System.out.println("There is no discount");

           System.out.println("The final price is " + cdCount*3.5);

       }

       if(cdCount >= 15 && cdCount<=50)

       {

           System.out.println("You have a 1% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.01);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

       if(cdCount >= 51 && cdCount<120)

       {

           System.out.println("You have a 5% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.05);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

       if(cdCount >= 120)

       {

           System.out.println("You have a 10% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.1);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

   }

Which number is equivalent to 72.5e-2?
0.725

72.5

7.25

7250

Answers

Answer:

.725

Explanation:

You are going back 2 spaces.

Answer:

0.725

Explanation:

Edge 2022

Use JavaWrite a program that will simulate a change machine found at cash registers. Input the amount due and amount paid from the keyboard.Tell the user how much change is owed and number of quarters, dimes, nickels, and pennies in change a customer would receive.Pay special attention to roundoff error. Your program should use division and modular division. No if’s or loops may be used. You may assume all change will be a positive number with no more than two decimal places. If more than $1.00 is owed, the full value should be included in the number of quarters returned. For example, $2.50 should be returned as 10 quarters.Hint: Modular division is a great way to find the remainder of a division. Think about how you can use this to calculate the change that is left over after some coins are given.Sample Run:Please Enter the Cost of the Item:4.57Please Enter the Amount Paid:5.00Change Owed: 0.43Quarters: 1Dimes: 1Nickels: 1Pennies: 3

Answers

Answer:

Here is the JAVA program:

import java.util.Scanner;  //to accept input from user

public class Main { // class name

 public static void main(String [] args) {  // start of main method

   Scanner input = new Scanner(System.in);  // creates Scanner class object to take input from user

   System.out.println("Please Enter the Cost of the Item: ");  // prompts user to enter the cost of item

   double itemCost = input.nextDouble();  //scans and reads the input value of item cost

   System.out.println("Please Enter the Amount Paid: ");  // prompts user to enter the amount paid

   double amount = input.nextDouble();  //scans and reads the value of amount from user

   int change = (int)(amount * 100 - itemCost * 100);  //compute the remaining amount i.e. change

   System.out.println("Change Owed: " + change / 100.0);  // displays the owed change

   int quarters = change / 25;  // computes the value for quarters

   change = change % 25;  // compute the quarters remaining

   int dimes = change / 10;  //  computes dimes

   change = change % 10;  //  computes dimes remaining

   int nickels = change / 5;  // computes nickels

   change = change % 5;  // compute nickels remaining

   int pennies = change;  // computes pennies

   System.out.println("Quarters: " + quarters);  // displays computed value of quarters

   System.out.println("Dimes: " + dimes);  // displays value of dimes

   System.out.println("Nickels: " + nickels);  // displays value of nickels

   System.out.println("Pennies: " + pennies);   }} //displays value of pennies

Explanation:

I will explain the program with an examples.

Suppose the user enters 4.57 as cost of the item and 5.00 as amount paid. Then the program works as follows:

Change is computed as

change = (int)(amount * 100 - itemCost * 100);

This becomes;

change = (int)(5.00 * 100 - 4.57 * 100)

            = 500 - 457

change = 43

Now the change owed is computed as:

change / 100.0 = 43/100.0 = 0.43

Hence change owed = 0.43

Next quarters are computed as:

quarters = change / 25;

This becomes:

quarters = 43/25

quarters = 1

Now the remaining is computed as:

   change = change % 25;

This becomes:

   change = 43 % 25;

  change = 18

Next the dimes are computed from remaining value of change as:

dimes = change / 10;

dimes = 18 / 10

dimes = 1

Now the remaining is computed as:

   change = change % 10;

This becomes:

   change = 18 % 10

  change = 8

Next the nickels are computed from remaining value of change as:

nickels = change / 5;

nickels = 8 / 5

nickels = 1

Now the remaining is computed as:

   change = change % 5;

This becomes:

   change = 8 % 5

  change = 3

At last the pennies are computed as:

pennies = change;

pennies = 3

So the output of the entire program is:

Change Owed: 0.43                                                                                                                Quarters: 1                                                                                                                      Dimes: 1                                                                                                                         Nickels: 1                                                                                                                       Pennies: 3  

The screenshot of the output is attached.

Write a C++ program that converts a measurement given in feet into the equivalent number of (a) yards, (b) inches, (c) centimeters, (d) meters. The program should first prompt the user to enter the number of feet to be converted. It should then read that value, calculate each of the converted lengths, and then display the converted lengths, rounded to two decimal places of accuracy. You should assume that the number of feet entered will be a floating point value. Note: All the converted lengths will also be floating point values. Conversion facts: 1 yard = 36 inches; 1 foot = 12 inches; 1 inch = 2.54 cm; 1 meter = 100 cm. Here is what output should look like from running the program (user input is shown in bold):Enter number of feet: 4= 1.33 yards= 48 inches= 121.92 cm= 1.22 metersPlease give me the pseudocode first similar to this:Display " "Read ...Let...Let...Display...Because this format of the pseudocode is required as part of the solution. Thank you!

Answers

Answer:

#include<iostream>

using namespace std;

int main()

{

float feet, yard, inch, meter, cmeter;

cout<<"Enter number of feet: ";

cin>>feet;

yard = feet * 12/36;

inch = yard * 36;

cmeter = inch * 2.54;

meter = cmeter * 100;

cout<<feet<<" feet = "<< yard<<" yard = "<<inch<<" inches = "<<cmeter<<" cm = "<<meter<<" m";

return 0;

}

Explanation:

This line declares all necessary variables

float feet, yard, inch, meter, cmeter;

The line prompts user for number of feet

cout<<"Enter number of feet: ";

This line gets user input

cin>>feet;

The next 4 lines converts feet to yard, inches, centimeter and meter

yard = feet * 12/36;

inch = yard * 36;

cmeter = inch * 2.54;

meter = cmeter * 100;

This line prints converted units

cout<<feet<<" feet = "<< yard<<" yard = "<<inch<<" inches = "<<cmeter<<" cm = "<<meter<<" m";

What is the value of the variable result after these lines of code are executed?

>>> a = 10
>>> b = 2
>>> c = 5
>>> result = a * b - a / c
The value of the variable is
.

Answers

Answer:

18

Explanation:

If you take the formula, and you substitute the values of the variables, it will be:

    10 * 2 - 10 / 5

Then if you remember the order of math operations, it will be:

    (10 * 2) - (10 / 5)

Which reduces to:

    20 - 2 = 18

The value of the variable result is 18

The code is represented as follows:

Python code:

a = 10

b = 2

c = 5

result = a * b - a / c

Code explanation;The variable a is initialise to 10The variable b is initialise to 2Lastly, the variable c is initialise to 5

Then the arithmetic operation  variable a multiplied by variable b minus  variable a divided by variable c is stored in the variable "result".

Printing the variable "result" will give you 18.

Check the picture to see the result after running the code.

learn more on coding here: https://brainly.com/question/9238988?referrer=searchResults

Is Zero (Sam Fisher, Rainbow Six Siege version of course) overpowered because of the fact he has a gun that does 45 damage at a fire rate of 800rpm

Answers

Answer:

Yes

Explanation:

I see his damage and rpm as unfair because of the fact that he can deal over 36,000 damage in one minute.

Plz answer me will mark as brainliest ​

Answers

Answer: 14. Operating     15. False   I hope this helps :)

Explanation:

// DebugFive1
// Adds your lunch bill
// Burger and hot dog are $2.59
// Grilled cheese and fish are $1.99
// Fries are 89 cents
import java.util.*;
public class DebugFive1
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
final double HIGH_PRICE = 2.59;
final double MED_PRICE = 1.99;
final double LOW_PRICE = 0.89;
String usersChoiceString;
int usersChoice;
double bill;
System.out.println("Order please\n1 - Burger\n2 - Hotdog" +
"\n3 - Grilled cheese\n4 - Fish sandwich");
usersChoiceString = input.next();
usersChoice == Integer.parseInt(usersChoiceString);
if(usersChoice == 1 && usersChoice == 2)
bill = bill + HIGH_PRICE;
else
bill = bill + MED_PRICE;
System.out.println("Fries with that?\n1 - Yes\n2 - No";
usersChoiceString = input.next()
usersChoice = Integer.parseInt(usersChoiceString);
if (usersChoice = 1)
bill = bill + LOW_PRICE;
System.out.println("Bill is " + bill);
}
}

Answers

Answer:

See Explanation

Explanation:

The lines with incorrect syntax and corrections are:

1.

Line:

usersChoice == Integer.parseInt(usersChoiceString);

Error

The error is that a relational operator (==) is used instead of an assignment operator (=)

Correction

usersChoice = Integer.parseInt(usersChoiceString);

2.

Line:

System.out.println("Fries with that?\n1 - Yes\n2 - No";

Error:

The line requires a corresponding close bracket

Correction

System.out.println("Fries with that?\n1 - Yes\n2 - No");

3.

Line:

usersChoiceString = input.next()

Error:

The line is not terminated

Correction:

usersChoiceString = input.next() ;

4.

Line

if (usersChoice = 1)

Error

A relational operator is needed

Correction:

if (usersChoice == 1)

Lastly, you need to initialize bill to a value or prompt user for input.

I've added the full source code as an attachment

2. What types of news can be created?

Answers

Answer:

Print Media

Broadcast Media

Explanation:

It can be made manually/artificially (meaning that someone caused something to happen on purpose) or naturally (meaning it just happened with out outside assistance)

Hope this helps you

2.) Multiple choice questions
1. Which function key is used to update the total in cell?
(a) F7
(b) f8
(c) f9
2. The intersection of a column and row is called a
(a) Border
(b) table
(c) cell
3. Tables group is present on the
tab.
(a) layout
(b) insert
(c) home
4. Which key combination moves the cursor to the previous cell?
(a) Tab + alt
(b) shift + tab (c) none of these
5. Which style affects the selected text within a paragraph?
(a) Character style (b) paragraph style
(c) built-in style

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

Which function key is used to update the total in cell?        

(a) F7

(b) f8

(c) f9      

The intersection of a column and row is called a

(a) Border

(b) table

(c) cell

Tables group is present on the  tab.

(a) layout

(b) insert

(c) home        

Which key combination moves the cursor to the previous cell?

(a) Tab + alt

(b) shift + tab

(c) none of these      

5. Which style affects the selected text within a paragraph?

(a) Character style

(b) paragraph style

(c) built-in style

Remy’s manager has asked him to change the background color scheme from reds to blues in the standard template the company uses for employee training presentations. She cautioned him not to change any other elements of the template.

What should Remy do in the Slide Master view to change only the color scheme?

In the Background group, select Colors, and find a color scheme that fits.
Choose Edit Theme, and select a new theme that includes a blue background.
Go to the Master Layout group, click Insert Placeholder, and choose a placeholder with a blue background.
Change the background color to light blue, and save the file as a new presentation rather than as a template.

Answers

Answer:

A on edg

Explanation:

I took the assigment

Answer: in the background group, select colors, and find a color scheme that fits.

Explanation:

Common lossless compressed audio file formats include
WMA and JIFF
WAV and AU
MP3 and MP4a
FLAC and ALAC

Answers

Answer:

The answer to this question is given below in the explanation section. The forth one (FLAC and ALAC) is the correct option.

Explanation:

Common lossless compressed audio file formats include

WMA and JIFF WAV and AU MP3 and MP4a FLAC and ALAC

Lossless compression formats include the common FLAC, WavPack, Monkey's Audio, ALAC (Apple Lossless).  Other options are not common lossless compressed audio formats.

Answer:d d

Explanation:

Other Questions
Why do you think the people who wrote the Constitution create differentbranches of government, the executive, legislative, and judicial branch? You need to find two numbers where one number is 4 times as large as the other and where the difference isthe two numbers are 39. What are the numbers? equation Endpoint: (-8, -10), midpoint: (10,-7) Find the value of x. explain the theorem used in solving for the range of possible lengrhs of the third side AB of ABC You own your own bakery. In the cooler you have 3 chocolate cakes and 4 vanilla cakes. In the warmer you have 1 pumpkin pie, 5 apple pies and 3 blueberry pies. What is the ratio of pies to cake you have available? how to solve this problem 3x+5=2x+1 I need help my mom is going to kill me The book belongs to you and your sister.The book is will give brainliest!! What is the effect of the Arab spring name of the philosopher to a description of his ideology Please help fast answer both questions please 1. Christian history begins with whom? Where was he born? What town was his father andfamily from? When was he baptized? Please help me it would mean a lot I can add fractions with unlike denominators. 2/5 + 3/10 = The ability of the_____to perform physical tasks over a period of____without becoming fatigued A plumber earns $50 for a repair job, plus an additional $75 per hour he works. On Tuesday, he completed 3 repair jobs and earned a total of more than $600. Part A: Write an inequality that can be used to determine h, the number of hours the plumber worked Tuesday. Can somebody help me? Write the nature of roots of the quadratic equation 9x^2 -6x+2