Array, Classes And Constructor Method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gacrux
    New Member
    • Mar 2008
    • 1

    Array, Classes And Constructor Method

    1) In a class named AnyIntegers, prompt the user to enter 100 integers into a two-dimensional array. Use a method countEvenNum of the class CollectEvenNumb er to determine the total even number stored in the array.

    2) Write a class named GameScores that receives the score and player name through its constructor. Initialize and return these data. Write a class named MindGame that inherits GameScores class. Reads 100 player’s name and score from user. Identify total number of player whose score is 10.

    I need help in these 2 questions using BlueJ. Thanks alot
  • mia023
    New Member
    • May 2007
    • 89

    #2
    Originally posted by Gacrux
    Write a Java program that creates 50 random numbers ranging 1 to 6 and store them in TWO dimension array. The program should keep track on the frequency of each of the numbers and creates the histogram as shown below:

    Sample output
    Random Numbers Frequency Histogram
    1 9 ******
    2 10 **********
    3 7 *******
    4 8 ********
    5 10 **********
    6 6 ******


    I need help in this question using BlueJ. Thanks
    use java.util for creating Random numbers and store them in the multidimensiona l array then use if else clause for the Frequency of each.

    Comment

    • mia023
      New Member
      • May 2007
      • 89

      #3
      Originally posted by mia023
      use java.util for creating Random numbers and store them in the multidimensiona l array then use if else clause for the Frequency of each.
      for the 2nd problem you have to use a counter to keep track of the scores and increment it each time score is 10

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Gacrux
        1) In a class named AnyIntegers, prompt the user to enter 100 integers into a two-dimensional array. Use a method countEvenNum of the class CollectEvenNumb er to determine the total even number stored in the array.

        2) Write a class named GameScores that receives the score and player name through its constructor. Initialize and return these data. Write a class named MindGame that inherits GameScores class. Reads 100 player’s name and score from user. Identify total number of player whose score is 10.

        I need help in these 2 questions using BlueJ. Thanks alot
        ... and what have you done so far?

        Comment

        Working...