Forum: Java Apr 27th, 2009 |
| Replies: 1 Views: 1,017 I am having trouble printing onto a JPanel. I am able to print any string that i want to. here my code:
import javax.swing.JFrame;
import java.awt.BorderLayout;
import javax.swing.JLabel;
... |
Forum: Java Apr 20th, 2009 |
| Replies: 2 Views: 619 That was it thank you. i also another another line to print ovals as well. |
Forum: Java Apr 20th, 2009 |
| Replies: 2 Views: 619 I am trying to create random rectangles and ovals. This is what i ahve so far:
import java.awt.Color;
import java.awt.Graphics;
public class MyRectangle
{
private int x1;
private int y1;... |
Forum: C++ Nov 30th, 2007 |
| Replies: 6 Views: 2,053 First off fix this
cout << "Enter your address starting with your name then street then city then state then zip code, seperate each section with a space and then a # the immediatly following the... |
Forum: C++ Nov 30th, 2007 |
| Replies: 5 Views: 9,387 I love you too baby =D what part of SD you live? i got family in soiux falls or something like that.
void showMedian(int *array, int size)
{
double middle;
double average;
middle =... |
Forum: C++ Nov 30th, 2007 |
| Replies: 5 Views: 9,387 current code:
void showMedian(int *array, int size)
{
double middle;
double average;
middle = size / 2; |
Forum: C++ Nov 30th, 2007 |
| Replies: 8 Views: 4,367 WOOT finally got it to work. Thnks for all the help
Final Code:
void findMode(int *array, int size, int large)
{
int *array2;
int count;
int x; |
Forum: C++ Nov 30th, 2007 |
| Replies: 8 Views: 4,367 >> Note: as I understand the definition of mode, if you have two or more values with the same occurrence count, you don't have a mode.
thats not it at all. lol if anything its the other way... |
Forum: C++ Nov 30th, 2007 |
| Replies: 11 Views: 1,043 grr... LOL yea i saw that and things feel in place... ty |
Forum: C++ Nov 30th, 2007 |
| Replies: 11 Views: 1,043 #include <iostream>
using namespace std;
void findMode( int *, int, int);
void selectionSort(int *, int);
int main()
{
int *numbers; //dynamically allocate an array
int... |
Forum: C++ Nov 30th, 2007 |
| Replies: 11 Views: 1,043 error C2143: syntax error : missing ';' before '<' on this line "if (array[index] < minElem)"
i actually tried to do it this way a couple of attempts back, but why its asking me to add the ;... |
Forum: C++ Nov 30th, 2007 |
| Replies: 8 Views: 4,367 >> a - use two arrays ( or a 2D array) in the function - store values found and a count of times found - you have to search through the array for each source value.
i thought thats what i was... |
Forum: C++ Nov 30th, 2007 |
| Replies: 11 Views: 1,043 ≥≥ And why is minElem in the sort function a pointer?
it how the book had it, so i made it that way. =/ that would chunk was taken fro the book.
I went ahead and made the changes with
>> 7:... |
Forum: C++ Nov 29th, 2007 |
| Replies: 11 Views: 1,043 LOL
i thought i highlighted it was red... my mistake
When it refers to
selectionSort(numbers, elements); is when i get the error on line 41
i believe i must not be calling the void... |
Forum: C++ Nov 29th, 2007 |
| Replies: 11 Views: 1,043 Here is the error:
cannot convert parameter 1 from 'int *' to 'int *[]'
here is my code: |
Forum: C++ Nov 29th, 2007 |
| Replies: 8 Views: 4,367 something just hit me, If i find the largest value in the array before hand, i can just create an array large enough to hold 0 to that value. if that makes sense. this is what i tweeked it to:
... |
Forum: C++ Nov 29th, 2007 |
| Replies: 8 Views: 4,367 Current Code:
void findMode(int *array, int size)
{
int array2[size];
int count;
int x;
int mode = 0;
for (count = 0; count < size; count++) |
Forum: C++ Nov 22nd, 2007 |
| Replies: 6 Views: 1,313 so in other words the swap between the whole word cannot be done with arrays, so to actually do the swap every letter needs to be changed out. i get it now, thanks for the help, and happy... |
Forum: C++ Nov 22nd, 2007 |
| Replies: 6 Views: 1,313 im not looking for the int to be swapped in this case, i can do thats much, its the char array that i want to switch.
so as an example:
jill is in the first column and
jam is in the second... |
Forum: C++ Nov 22nd, 2007 |
| Replies: 6 Views: 1,313 after searching around some more i found that arrays cant be set to something like the way i have it set up. i found that changing char charTemp[30]; to string charTemp; seem to fix some of them, but... |
Forum: C++ Nov 22nd, 2007 |
| Replies: 6 Views: 1,313 i am seeing this error:
error C2106: '=' : left operand must be l-value
here is the code
bool swap;
int numTemp;
char charTemp[30];
int count;
do |
Forum: C++ Nov 22nd, 2007 |
| Replies: 1 Views: 1,344 Heres my current code:
const int SIZE = 100; //constant 100
const int COL = 30; //number of columns
int testScores[SIZE]; //test score array
char... |
Forum: C++ Nov 13th, 2007 |
| Replies: 1 Views: 805 here is my current code:
#include <iostream>
using namespace std;
int bubbleSort(int [], int);
int selectionSort(int [], int);
void showArray(int [], int);
const int SIZE = 20;
int main() |
Forum: C++ Nov 12th, 2007 |
| Replies: 4 Views: 1,371 It will not be able to know the difference between the names and the actual numbers when you read the files and set them to something. fyi |
Forum: C++ Nov 12th, 2007 |
| Replies: 5 Views: 950 If you want it to print out 0's then set the array to 0's
int seats[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
with this you're setting each array with it's respective number.
also as a heads up... |
Forum: C++ Nov 12th, 2007 |
| Replies: 3 Views: 1,043 <Yeah, thanks. I think I get it, but only time will tell.
You sound iffy, so in other words what that first line does for you is it gives it an assigned value. without an assigned number it can't... |
Forum: C++ Nov 9th, 2007 |
| Replies: 7 Views: 636 Woot:
double qtrsSales[NUM_QTRS];
qtrsSales[0] = 0;
qtrsSales[1] = 0;
qtrsSales[2] = 0;
qtrsSales[3] = 0;
That fixed it. Ty. |
Forum: C++ Nov 9th, 2007 |
| Replies: 7 Views: 636 lol i know im close =p
<The reason you get the funny number is that each element of qtrsSales, qtrsSales[i], is an object of type double. If you try to add something to a double without... |
Forum: C++ Nov 9th, 2007 |
| Replies: 7 Views: 636 Thanks for the help again, Here another part which i don't understand:
double qtrsSales[NUM_QTRS];
for (int x = 0; x < div; x++)
{
for (int y = 0; y <... |
Forum: C++ Nov 9th, 2007 |
| Replies: 7 Views: 636 I changed two things it went from y+1 and y to y and y-1 with the counter set to 1 and now it works, thanks here the code
for (int y = 1; y < NUM_QTRS; y++)
{
cout << "For division " <<... |
Forum: C++ Nov 9th, 2007 |
| Replies: 7 Views: 636 Heres the part of the code That i have:
#include <iostream>
using namespace std;
const int NUM_DIV = 6; //Number of divisions
const int NUM_QTRS = 4; //Number of quarters |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 I finally said F it all and got parallels with XP.
End of story. |
Forum: C++ Nov 8th, 2007 |
| Replies: 15 Views: 3,856 Sometimes misspelling a word can effect the outcome of your coding
IE
char peoples = 'Narue';
count << peopeles;
It can also help you make your point come across a bit clearer
IE |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 Xcode is a negative as well |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 I went to the apple site after trying to find GCC and i found this:
http://www.apple.com/downloads/macosx/development_tools/crosscompilerforwin32.html
After downloading it i have no clue where it... |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 word.
Right now im chillin at my schools library which for some retarded reason does not have a C++ compilier on any of the computers i can get on. GG school compters. I'll drive home and test it... |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 I have one of the new IMac with the new OS on it.
2.4GHz Intel Core 2 Duo
3 GB memory
320GB hard drive1
8x double-layer SuperDrive
ATI Radeon HD 2600 PRO with 256MB memory
<you should... |
Forum: C++ Nov 8th, 2007 |
| Replies: 15 Views: 3,856 LOL Narue you are my new idol. <3 and yes i appreciate it.
bums who want everything done for them are lose. This site helps out, a lot i might add. It a give take situation. They do not do the work... |
Forum: C++ Nov 8th, 2007 |
| Replies: 10 Views: 1,249 Heres the situation:
I am taking a C++ course online. I had a PC up until about a week ago when i got a Mac. Now i must do all my work on the only computer i have, the Mac. I turn in my work at the... |
Forum: C++ Nov 8th, 2007 |
| Replies: 9 Views: 862 Lol is there a way to kill treads, this one just seems useless. |