Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - KadeBL_ID12958

Pages: [1] 2 3 4 5 6 ... 367
1
I found out what was frustrating me.

My problem here is that I don't know how to get the sum of all the elements of the array. I've searched around a lot and I can't find a direct answer. This assignment calls for 3 functions that require I use the sum of all the elements, yet I can't find out how. The content doesn't say anything about this. I mean i suppose i can call it individually like
Code: [Select]
list[1] + list[2] + list[3] but seeing as there are 20 elements, something tells me I need a more efficient way to add them all together.

Everything says to use a for loop but that only seems to work for the length? I'm missing something.

2
Off Topic / Re: 1 word
« on: April 24, 2014, 03:39:52 PM »
take

3
Yeah, my class's content was written by a Mr. Leon Schram and his kid-- to understand any of it I have to do exercises which ask questions in plain english, however with this unit, i couldn't finish them all because it was worded so strangely.

4


That clears up a lot, thanks. I was assuming something along those lines, but it seemed a little blurry because of the way the text reads.



This too.

5
Off Topic / Re: 1 word
« on: April 24, 2014, 03:20:09 PM »
backwards

6
Creativity / Re: The new and improved 3D model topic!
« on: April 24, 2014, 02:41:32 PM »


I need to work on that handle on the key. It looks gross.

7
   I have a slow paced, badly taught computer science class in which we use "JCreator" as our JRE. The class is pretty easy despite being poorly taught, as all of the content was taken from another teacher from another school, and the teacher shows signs of not knowing what she's talking about, but that's not important.

   I came to an area in the content that was written very peculiarly and i can't seem to understand it. What i need to do for an assignment is to find the mean, median, and mode of some arrays in order to display that I learned from the passage, which isn't making much sense. I don't really know where to start. I'll post the code by itself to give you some context on what i'm trying to find out. I'd appreciate it if any of you could help me with this. (I'm not asking you to do it, i'm really just trying to figure it out). What exactly does toString and fill do, and
is list[index] actually just an identifier/variable or is the "index" between brackets a reserved word?
Code: [Select]
import java.util.Arrays;
import java.util.Random;


public class TextLab06st
{

public static void main(String args[])
{
System.out.println("\nTextLab06\n");
System.out.print("Enter the quantity of random numbers  ===>>  ");
int listSize = Expo.enterInt();
System.out.println();
Statistics intList = new Statistics(listSize);
intList.randomize();
intList.computeMean();
intList.computeMedian();
intList.computeMode();
intList.displayStats();
System.out.println();
}
}


class Statistics
{

private int list[]; // the actual array of integers
private int size; // user-entered number of integers in the array
private double mean; // used for the  80, 100 and 110 point versions
private double median; // used for the 100 and 110 point versions
private int mode; // used for the 110 point version only

public Statistics(int s)
{
size = s;
list = new int[size];
mean = median = mode = 0;
}

public void randomize()
{
// This provided method creates the same exact list of "random" numbers for every execution.
// You will learn more about this in Chapter 14.  For now just use the provided method.
Random rand = new Random(12345);
for (int k = 0; k < size; k++)
list[k] = rand.nextInt(31) + 1;  // range of 1..31
}

public void computeMean()
{


}

public void computeMedian()
{


}

public void computeMode()
{
// precondition: The list array has exactly 1 mode.


}

public void displayStats()
{
System.out.println(Arrays.toString(list));
System.out.println();
System.out.println("Mean:    " + mean);
System.out.println("Median:  " + median);
System.out.println("Mode:    " + mode);
}

}






(This is probably the wrong place for this thread, but I wasn't sure where else to put it. It was either this or mod discussion, but I don't remember if mod discussion was exclusively blockland or not. It's been a little while).



9
Forum Games / Re: YOU CRINGE YOU LOSE | I am a winner
« on: July 05, 2013, 10:44:44 AM »

10
Off Topic / Re: Tumblrs?
« on: March 16, 2013, 02:45:57 AM »
I don't like most tumblr users because they have this horrible trend of talking stupid and saying stuff like swag and yolo. I dunno what goes on on that site but its ruining our brains.
that would be twitter my dear acquaintance

11
Off Topic / Re: Do your eyes go black sometimes?
« on: January 05, 2013, 03:53:06 AM »
I passed out once, it was actually kind of fun.

12
Off Topic / Re: handicapify the above users name
« on: December 17, 2012, 03:06:18 PM »
da toredumbas nippl

13
Off Topic / Re: Has the above user been banned before?
« on: December 16, 2012, 08:49:43 PM »
yes

14
Off Topic / Re: Has the above user been banned before?
« on: December 16, 2012, 11:39:04 AM »
at least once, i think

15
Off Topic / Re: Does anybody else normally piss in their sink?
« on: December 16, 2012, 11:00:21 AM »
Isn't she a stupid hoe?
shes actually a genius, but she pretends to be a stupid hoe to appeal to society. Which I guess makes her a stupid hoe.

Pages: [1] 2 3 4 5 6 ... 367