Write a class and client class that stores hotels ratings

Assignment Help JAVA Programming
Reference no: EM13167945

Write a class and client class that stores hotels ratings over the years. The number of stars represents hotel ratings. Use a two dimensional integer array to represent the years and hotels. The columns can represent the years and the rows the hotels. Each element of the 2-dimensional array stores an integer value between 1 - 5, which represents the number of "stars" this hotel has. You can initialize the 2-dim array at the beginning of your program.

In addition, declare a one dimensional String array that stores the names of the hotels and each location corresponds to the hotel in each row of the 2-dim array. Define another String array containing the years.

For example:

String hotels = {"Best Value", "Western Inn"};

String years = { "2005", "2006", "2007", "2008"};

Hotels location zero (hotels [0]) corresponds to  array[0][0]

Your program should output for each hotel and each year the number of stars received.
Use the asterisk "*" symbol to indicate the number of stars earned.

For example:

                        2005    2006    2007    2008

Best Value       *****  ***      ****    **

Western Inn    ***      *          ***      *****

You need to create three nested loops.

  For(int m=0; m< hotels.length; m++)
  {

            For(col=0; col<array[m].length;col++)
            {

                        For(i=0; i<=array[m][col]; i++)
                        {   //print the asterisk}

                        //print a tab before getting the new value for the hotel stars

 

 

Reference no: EM13167945

Questions Cloud

Explain how much ice is required to cool : When ice melts, it absorbs 0.33 kJ per gram. How much ice is required to cool a 13.0 oz drink from 74 degree F to 31 degree F
Atm system code two classes with related attributes : Related to ATM system code two classes with realted attributes and operations!in C++
Explain and identify the type of interactions : Identify the type of interactions involved in each of the following processes taking place during the dissolution of sodium chloride in water. -Interactions between water molecules
Historical crimes have changed the culture : Determine if these historical crimes have changed the culture or ethics associated with computers and information management. Explain the effectiveness of existing computer crime detection methods and technologie
Write a class and client class that stores hotels ratings : Write a class and client class that stores hotels ratings over the years. The number of stars represents hotel ratings. Use a two dimensional integer array to represent the years and hotels
Explain the enthalpy of vaporization of water : how much heat is released when 75.0 g of steam at 100.0°C is cooled to ice at -15.0°C? The enthalpy of vaporization of water is 40.67 kJ/mol
A one-variable quadratic expression : A one-variable quadratic expression is an arithmetic expression of the form ax^2+bx+c, where a,b, and cc are some fixed numbers (called the coefficients) and x is a variable that can take on different vaues
Explain natural water was determined by precipitation : The iron (55.847 g/mol) in a 700.0 mL sample of a natural water was determined by precipitation of the cation as hydrated Fe2O3. The precipitate was filtered
Explain how many moles of oxygen are needed to react : How many moles of oxygen are needed to react with 5.0 moles of ammonia? In the above reaction, how many moles of water can be produced from 256 grams of oxygen?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Correct example of inheritance

Which of the following relationships is not a correct example of inheritance?  Parent to Children  Aunt to Uncle  Grandparent to Grandchild

  Three most primary forms of loops: the while loop, the do..

explored the world of loops we have accepted the three most primary forms of loops: the while loop, the do...while loop (even though Python does not use this loop), and the for loop. The for loop has approximately three primary implementations that w..

  Write program with jframe to enter series of names

Write a program with JFrame which permits user to enter series of friends' names and phone numbers and creates file from entered data.

  You must also do the work of sorting

You must also do the work of sorting in the method. You cannot just call another library method. Use loops to show the data in the original array as well as the repopulated array in ascending order.

  Write an interface for a bagadt that implements iterable

Write an interface for a BagADT that implements the Iterable interface. Include javadoc comments that will generate specifications for the BagADT so that someone who wants to implement this interface will know what each method does.

  T an array using insertion sort and track the number of swap

How to sort an array using insertion sort and track teh number of swaps during the sorting

  Values that occur just once

This list has some values that occur just once (1, 3, 4, 11, 13, 18), some values that occur twice (9, 16), some values that occur three times (14, 19) and a single value that occurs four times (7). Therefore, the call of list.maxCount() should re..

  Write a recursive instance method

Write a recursive instance method

  What value would be returned from call to its size() method

If a collection stores 5 objects, what value would be returned from a call to its size() method?

  Write a program that prompts for and accepts input of test

write a program that prompts for and accepts input of test ggrades that are integers between 0 and 100. For each numerical test grade,  program should display a corresponding letter grade

  Use a loop to allow a user to enter a series of numbers

Use a loop to allow a user to enter a series of numbers and then print out the series of numbers when the user is done. The user stops the lseries program by entering -1 (or any negative number).

  Write a java program to compute salary

Write a Java program which computes the Salary for a given number of employees. The program prompts user to enter n the number of employees.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd