Your program should have annbspappnbspclass that contains


Task: Create an Object Oriented Java application to model a band competition.

Please make sure that your application meets all of the following requirements:

  • Your program should have an App class that contains you rmain() method, and a Band class as described below.
  • Create an array of 5 Band objects in your main() method.
  • For each Band, call it'scompete()method, which will assign a random score between 0 and 20 to to that band.
  • Calculate the top 3 finishers and write their information to a "winners.txt" file.
  • Create a UML Class Diagram for your Band class

Note:

  • Your Band class must be properly encapsulated
  • You must use a for loop somewhere in your project

For the sake of simplicity, you may assume that each band has:

  • A singer
  • A guitar player
  • A bassist
  • A drummer

In addition to the name of each player in the band, your Band class should store each band's:

  • Home town
  • Annual income from record sales
  • Genre of music (e.g. rock, punk, reggae, jazz)
  • Score in the competition (an integer between 0 and 20)

Your Band class must include the following methods:

  • constructor, which sets all of the values of each attribute.
  • A  compete() method, which creates a random value between 0 and 20 and assigns it to that band's score attribute.
  • getInfo() method, which returns all of the information about that band

Your App class must calculate the top 3 finishers (i.e. bands with the highest score attribute), and write all of their information to a file.

Note: You do not need to use the Scanner class to input information about the bands from the user.  You may hard code all of this information in your main() method, but you should not hard code any band information (names, etc.) in your Band class itself.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Your program should have annbspappnbspclass that contains
Reference No:- TGS02178389

Now Priced at $30 (50% Discount)

Recommended (97%)

Rated (4.9/5)