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

  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.

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Java program use breadth-first search closest broadcast

Write the java program which will use breadth-first search (which you implement as part of your program) to determine the closest broadcast vertex for each vertex in graph.

  Write a recursive instance method

Write a recursive instance method

  Write a program to read a file and encode

Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name

  Use inheritance to read, store, and print questions for test

use inheritance to read, store, and print questions for a test. First, write an abstract class

  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.

  A method with the signature public static void

A method with the signature public static void printDetails(City[] cities) that will iterate through the cities and printthe details of the city using the displayDetails(...) method.

  Implement the lexical and syntactic analysis

Implement the lexical and syntactic analysis of Minifun programming language.

  Accepts a string as its parameter and returns an integer

Write a method in java named secondHalfLetters that accepts a string as its parameter and returns an integer representing how many of letters in the string come from the second half of the alphabet

  Java program to create a tree

Java program to create a tree, generate class - BottomUpTwoThreeFourTree, BottomUpTwoThreeFourTree,

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

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