473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Array, Classes And Constructor Method

1
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 CollectEvenNumber 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
Mar 30 '08 #1
3 2621
mia023
89
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 multidimensional array then use if else clause for the Frequency of each.
Mar 30 '08 #2
mia023
89
use java.util for creating Random numbers and store them in the multidimensional 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
Mar 30 '08 #3
r035198x
13,262 8TB
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 CollectEvenNumber 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?
Mar 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mike P | last post by:
I have, what should be, a simple scope problem. Can you help me fix this? I'm trying to end up like this: originalArray = and newArray = . Instead I wind up like this: originalArray = and...
24
by: Chad Z. Hower aka Kudzu | last post by:
I need to store a list of classes, not the instances of the classes. I had planned to use an array, but can use a collection or some other form if more appropriate. The problem I am having is...
2
by: david | last post by:
Well, as a matter of fact I_HAD_MISSED a basic thing or two, anyway, although Ollie's answer makes perfectly sense when dealing with classes, it doesn't seem to me to apply as well if you have to...
4
by: Eric A. Johnson | last post by:
For the following code: ' return String representation of CTriangleShape Public Overrides Function ToString() As String ' use MyBase reference to return CShape String Return...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
3
sammyboy78
by: sammyboy78 | last post by:
I'm trying to display an array of objects using a GUI. My instructions are that the CD class and it's sublcass don't need to change I just need to modify class CDInventory to include the GUI. I'm not...
6
sammyboy78
by: sammyboy78 | last post by:
I'm trying to display my array of objects in a GUI. How do I get JLabel to refer to the data in my objects? I've read my textbook and some tutorials online I just cannot get this. Plus all the...
4
by: Zerofury | last post by:
Okay here's what i'm trying to do. I want to create an array and fill it with objects, so that when i create a method to alphabetize them, all of the pieces (the price, name, ect) don't get all out...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.