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

  Create java program to find number of days left in that year

Create a Java program called "DaysLeftInYear.java" that outputs the number of days left in that year. use the calendar class to represent dates. Use the DateFormat class to display the current date in the output.

  Sorted list adt and the binary search tree adt

Explain the differences between our specifications of the Sorted List ADT and the Binary Search Tree ADT.

  Allows the user to enter students names followed

Write a program that allows the user to enter students names followed by their test scores and outputs the following information(assume that the maximum nmber of students in the class is 50

  Java-s ability to derive new fonts from existing ones

Find out where on your system these font libraries are located. When you do, please specify the operating system and the location (folder/directory) where you found them. Discuss Java's ability to derive new fonts from existing ones.

  Utilizes a good design process

Analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one function call and the use of at least one array.

  Java program that allows the user to enter a letter

Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the ci..

  Insert uml design diagrams, use case, classes

Insert UML design diagrams here (use case, class, and sequence diagram).

  The letters of the alphabet a through z

The letters of the alphabet A through Z can be represented in Morse code. Each letter is represented by a combination of up to four dots and/or dashes, as shown below. Use Java to write and run a console-window program that can convert an English ..

  Using notepad that implements a basic text analyzer

Write a Java application using Notepad that implements a basic Text Analyzer.

  Write a program that reads in a list of numbers from a file

write a program that reads in a list of numbers from a file and adds up all those numbers. You may hard code in the name of the file, allowing the user to input the filename is not required

  Create a deque class based on the discussion of deques

Create a Deque class based on the discussion of deques (double-ended queues) in this chapter. It should include insertLeft(), insertRight(), removeLeft(), removeRight(), isEmpty(), and isFull() methods.

  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.

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