2,827 Posted Topics

Member Avatar for kuay

Code tags. Please use them. [noparse] [code=JAVA] // paste code here [/code] or [code] // paste code here [/code] [/noparse] However, code tags are useless when the code is formatted the way you have formatted it. You need to indent in a way that blocks of code stand out. Here …

Member Avatar for kuay
-1
385
Member Avatar for Kathleen Tillma

[code] private JLabel message2JLabel; //display number of guesses [/code] You do nothing with this [ICODE]JLabel[/ICODE], so there's no sense having it. I see no variable named [ICODE]numGuesses[/ICODE] or anything similar. You need one. Initialize it to 0 in your constructor, then instantiate [ICODE]message2Label[/ICODE] in your constructor and set it to …

Member Avatar for VernonDozier
1
1K
Member Avatar for Manikyr

[QUOTE=dsladev;895283]i didnt know about the system("pause").. thanks[/QUOTE] Don't use it. [url]http://www.gidnetwork.com/b-61.html[/url]

Member Avatar for kangarooblood
1
452
Member Avatar for kuay

When we finish the assignment, should we post it here or should we submit it directly to your professor?

Member Avatar for kuay
0
94
Member Avatar for mossaied

You don't need two threads. Mark one solved. Also, for something this long, code tags are a must. I'd edit one of them to put code tags in or mark both solved and start a third thread using code tags. [noparse] [code=cplusplus] // code here [/code] [/noparse]

Member Avatar for VernonDozier
-1
323
Member Avatar for peter_budo

Typo in line 24? [code] public void [COLOR="Red"]pain[/COLOR]Component(Graphics g) [/code]

Member Avatar for peter_budo
0
157
Member Avatar for dsladev

[QUOTE=dsladev;895291]i got the program all situated.. i just need to know what to do with that one sentence... i have if/while/switch and all that in there..[/QUOTE] Post the code. We can't comment on what we can't see.

Member Avatar for dsladev
0
173
Member Avatar for smoore

You're getting the right answers and the logic seems OK. If you're looking for a critique of the code, I'd use more descriptive variable names and add comments so people can follow the logic more easily. In particular, you have a variable that you call other and initialize to 22, …

Member Avatar for yilmazhuseyin
0
267
Member Avatar for slawted

You have a brackets problem. You need to indent your code so that blocks of code line up. Otherwise you can't see brackets problems. You have an if statement (line 32) with a starting bracket but no ending bracket. Indent the code properly and the lack of bracket will really …

Member Avatar for Lerner
0
218
Member Avatar for jephthah

[QUOTE=niek_e;891694]I'm flagging this thread because it breaks the 'keep it clean' rule: :icon_wink:[/QUOTE] God's honest truth is I can't read leet. Is there something dirty in this thread? I'm assuming not because of the wink, but truth be told, you could probably call me every name in the book and …

Member Avatar for GrimJack
0
184
Member Avatar for anusha88

[QUOTE=anusha88;893484]hii,im new to java graphics.can anyone tell me how to create a circular slider(like a Jslider just its circular in fashion).[/QUOTE] Cross-posting wastes everyone's time. Don't do it. Pick one forum and stick with it. [url]http://forums.sun.com/thread.jspa?threadID=5392679&tstart=0[/url]

Member Avatar for smilingruheena
0
99
Member Avatar for jooa

[QUOTE=jooa;892012]Hi, I am trying to write some code which uses a JSlider to specify the number of lables to be displayed on a frame. I know how to create the JSlider and display it, but I am not sure how to implement different numbers of lables. I hope someone can …

Member Avatar for VernonDozier
0
106
Member Avatar for VernonDozier

I'm starting to experiment around with Java Web Start since applets have some limitations. I'm using Net Beans and it's working fine except that I get this pop-up when I run it: [quote] The application's digital signature cannot be verified. Do you want to run the application? [/quote] It would …

Member Avatar for VernonDozier
0
514
Member Avatar for johnnybravo_1

It's not displaying the whole line because you are overwriting a in this function: [code] void search (char b[]) { while (!in.eof()) { in >> a; if (strcmp(a,b)==0) { in.getline(a,255); cout << a <<endl; } } } [/code] You're using the >> operator. Take the line: [code] aaa bbb ccc …

Member Avatar for johnnybravo_1
1
772
Member Avatar for matt4615

[QUOTE=jephthah;891298] therefore, it is not an accurate model to select a number randomly between 1 and 40, six different times, ignoring and re-selecting any time a number is chosen that has already been selected during a previous pick. you must instead remove previously selected numbers from the field to begin …

Member Avatar for VernonDozier
0
847
Member Avatar for robbiepoo

Code tags please. [noparse] [code=JAVA] // paste code here [/code] [/noparse] Please repost with code tags and point to the specific lines where data should be adding up, but isn't. Thanks.

Member Avatar for masijade
0
87
Member Avatar for suncica2222

You need an instance of WinLsnrExp to use the a variable. You don't have one when you are trying to use a in main. a is not a static variable. main is a static function. Google "java static method" and "java static variable" for more information on what the word …

Member Avatar for suncica2222
0
279
Member Avatar for JackDurden

[QUOTE=Sky Diploma;890047][code=c++] node *Find_Empty_Node(node* root) { int index = 0; if(root) { if(root->data == 0)//<--I want this child return tree->child[index]; for(int i = 0;i<root->child.size();i++) { index = i; return Find_Empty_Node(root->child[i]); } } return tree; } [/code] Shouldnt this be the way to do it? I mean return the Empty Node …

Member Avatar for rcollins
0
111
Member Avatar for Metahuman

How about something like this? [code=JAVA] public class MyCalendar { private int month; private int day; private int year; private int hour; private int minute; private int second; public static int NUM_SEC_IN_MINUTE = 23; public static int NUM_MIN_IN_HOUR = 8; public static int NUM_HOUR_IN_DAY = 13; // etc. } [/code] …

Member Avatar for JamesCherrill
0
97
Member Avatar for Mubo

Code tags please. [noparse] [code=JAVA] // code here [/code] [/noparse] You have a few tasks. One, set up your overall mathematical plan. That includes setting up a sample graph, making rules for what the graph represents, with specific English explanations of what the node/edge values mean, and what it means …

Member Avatar for JamesCherrill
0
145
Member Avatar for cmick56

The program looks fine to me already. What's wrong with it? [quote] make the functions call by address [/quote] I don't know what you mean by this.

Member Avatar for ArkM
0
106
Member Avatar for slawted

[QUOTE=slawted;889645]Thank you for your help :) my first piece of code, nothing special to brag but gotta start somewhere :) i would also like to ask if i may, how to have me imput the radius for me to calculate the area?[/QUOTE] [code] std::cin >> radius; [/code] You're not calculating …

Member Avatar for slawted
0
99
Member Avatar for star34

You still have time to edit your post. Hit "Edit This Post", then "Go Advanced", and highlight your code, then press the "#" icon on the editing bar, then "Save Changes" and you should be in business.

Member Avatar for NeoKyrgyz
0
114
Member Avatar for VernonDozier

I have a webpage that is passed a string: [code] http://www.mywebsite.com/gallery.php?gallery=Sand_&_Surf [/code] Using the GET method, I am trying to do this: [code=php] $gallery = $_GET['gallery']; [/code] I want to store "Sand_&_Surf" in the [ICODE]$gallery[/ICODE] variable. From there, I do a database query and display all the paintings that are …

Member Avatar for VernonDozier
0
111
Member Avatar for JackDurden

Just a hunch, but are you trying to find, among all the non-null pointers in [ICODE]children[/ICODE], the one with the lowest index? For example assume that the [ICODE]children[/ICODE] vector has three elements: [code] children[0] is null children[1] is null children[2] is null [/code] Function should return null? [code] children[0] is …

Member Avatar for VernonDozier
0
255
Member Avatar for chaines51

[QUOTE=chaines51;888461]I've always been curious: in VS, and most other IDEs, you are allowed to do something like this: [code=c++] //in file class.h class blah { //prototypes, members, blah, blah blah } //in file class.cpp #include "class.h" //method definitions... etc. //in file main.cpp #include "class.h" int main { //do stuff with …

Member Avatar for VernonDozier
0
118
Member Avatar for bjanbkboi

Thank you for using code tags! (+rep) What's the question? Does it compile? Does it run? Does it run to completion, but give bad results? Also, please provide a short input file.

Member Avatar for ArkM
1
108
Member Avatar for GrimJack

[QUOTE=GrimJack;609187]Well, if you take war into account then all our best and brightest have been killed off every generation. It is always the strong, young men who fight and die thus leaving the weak and ill at home to produce the next generation. This is a more direct weeding out …

Member Avatar for GrimJack
0
718
Member Avatar for clisen

[QUOTE=clisen;886207]Alright, now I have a new problem. How would I remove a single element from the object array? I've tried a few things and looked it up, but I cant seem to get it. Lets say: [code] OBJECT ob1[3]; //class OBJECT [/code] And I want to remove the 3rd element …

Member Avatar for clisen
0
185
Member Avatar for JackDurden

Still doesn't make sense to me. Why would you push an integer onto a vector of node* ? Seems to me you should push a pointer to a node onto that vector.

Member Avatar for VernonDozier
0
107
Member Avatar for freelancelote

[QUOTE=freelancelote;886630]Hi, I'm having trouble with the following simple test program to extract 10 random numbers from 0 to 5. [CODE=java] import java.util.*; public class TestRandom { public static void main(String[] args) { Random rand = new Random(); for (int i = 0; i < 10; i++) { int j = …

Member Avatar for freelancelote
0
6K
Member Avatar for puk

[QUOTE=puk;886631]Hi, im writing an application in java that collects a number consisting of 5 digits,for example, 11234 from the user. The problem i have is that i want to separate the individual digits and display them separated by 3 spaces. thank you in advance for your help.[/QUOTE] You can use …

Member Avatar for javaAddict
0
82
Member Avatar for mahdi68

I question the wisdom of this function specification: [code] String toPostfix(String Q) [/code] Suppose Q = "12+34". What should the return value be? "1234+" ? Does that represent "1+234"? "12+34"? "123+4"? All three give different answers.

Member Avatar for NeoKyrgyz
0
155
Member Avatar for horiya

Please use code tags. [noparse] [code=cplusplus] // paste code here [/code] [/noparse] Your question is also too vague for this much code. What specific problem are you having ("It doesn't run" is too vague)?

Member Avatar for tux4life
0
133
Member Avatar for theCRK

You almost certainly have a brackets problem, either one bracket too many or one bracket too few. Format and use code tags to preserve that formatting. [noparse] [code=JAVA] // code here [/code] [/noparse] Without indentation, your chances of finding the bracket problem go way down. That's why consistent indentation is …

Member Avatar for VernonDozier
0
330
Member Avatar for ithelp

"Enter" key for me. I don't think it's because I use it so much, but I just use it more exuberantly. Every time I hit it, I crash down on it like "There, I'm DONE!".

Member Avatar for vegaseat
0
164
Member Avatar for fadia

He's not making fun of your code, he's critiquing it and offering advice on how to design a program. Blunt, yes, but programming is a blunt field. You need to develop a thick skin, take a deep breath, and don't worry about the TONE, but take the ADVICE, which is …

Member Avatar for ithelp
0
129
Member Avatar for KickAss2k1

You could probably write your own [ICODE]>>[/ICODE] operator, but if you use the regular [ICODE]>>[/ICODE] operator, it's going to use white space as a delimiter. [ICODE]getline[/ICODE] may be useful. Depending which [ICODE]getline[/ICODE] you use, you can it to read up to 20 characters or up to a specified delimiter. [url]http://www.cplusplus.com/reference/string/getline/[/url] …

Member Avatar for ArkM
0
255
Member Avatar for java-utm-stg

I see only one "else if" statement. You refer to a "second else if". I'm not 100% sure what you are trying to do. You are breaking a sentence into words, hence the " " delimiter. Correct? There are four instructions. I don't know if that means there are four …

Member Avatar for VernonDozier
0
79
Member Avatar for suncica2222

Java has a garbage collector. You don't need to destroy anything like you do in C++ with the [ICODE]delete[/ICODE] command. When it's no longer being used anywhere, Java will get rid of it. You can always set something to null. That means that you are done with the object. [code=JAVA] …

Member Avatar for Xhamolk_
0
92
Member Avatar for leverin4

[QUOTE=emint;885159]please help me on this issue, i could not complie tis maze. i am waiting ur reply, dun kno where i made mistake[/QUOTE] This thread has been marked solved, so people tend not to respond. You should start a new thread.

Member Avatar for VernonDozier
0
242
Member Avatar for tomata2

This program probably calls for a redesign where you have a Car class that keeps track of position, speed, and direction of the car. First step, just about always, is to decide what you want to do. From that, decide what you need to store and where you should store …

Member Avatar for VernonDozier
0
105
Member Avatar for wrigha

You should create a Walker class, and outside of that class have an array of Walker, a Collection of Walker, or simply three separate Walker objects. The Walker class shouldn't extend JApplet. Have Walking extend JApplet. So have at least two classes. The below can be in the Walking class, …

Member Avatar for VernonDozier
0
104
Member Avatar for VernonDozier

I'm experimenting around with Server Side Includes. I have them working fine using a .html extension. Trial.html file is below: [code=HTML] <html> <body> <!--#include virtual="HelloWorld.html" --> </body> </html> [/code] The .htaccess file looks like this: [code] AddHandler server-parsed .shtml .html .htm Options Indexes FollowSymLinks Includes [/code] HelloWorld.html is just a …

Member Avatar for VernonDozier
0
134
Member Avatar for boiishuvo

Code tags preserve formatting. [noparse] [code=cplusplus] // paste code here [/code] [/noparse] [code=cplusplus] #include <iostream> #include <string> using namespace std; const int MaxSize = 100; int actualNum = 8; string studentID[MaxSize]={"p1001","p1002","s000101","s000102","s000135","s990001","s990002","s000103"}; double studentMark[MaxSize]={78.5, 66, 73, 56.5, 88.3, 64.5, 45, 57}; char studentGrade[MaxSize]={'D', 'C', 'C', 'P', 'H', 'P', 'F', 'P'}; void …

Member Avatar for VernonDozier
0
533
Member Avatar for shakeelahmed22

[QUOTE=shakeelahmed22;882813]I need to write a program to print the below pattern of * representing the alphabet X. I am unable to print an X using asterisks in the post. I hope you can understand the below explanation. The X should have 7 rows - with three rows at the top …

Member Avatar for freelancelote
0
146
Member Avatar for redZERO

[QUOTE=redZERO;884463]Hi guys, I am using boolean variables as flags in a program and i want to be able to invert the value. for example if the current value is true, then it must be changed to false; doesn't matter if i don't know what the current value is.[/QUOTE] Use the …

Member Avatar for redZERO
0
437
Member Avatar for cruisx

Use code tags: [noparse] [code=cplusplus] // code goes here [/code] or [code] // code goes here [/code] [/noparse] Your code appears to have gotten cut off. You have some #include statements that you don't need, but that may not be a problem. Don't use conio.h if you can help it. …

Member Avatar for VernonDozier
0
366
Member Avatar for shakeelahmed22

[QUOTE=shakeelahmed22;883461]oh...plzzzzzzzz can any1 help me out wid this?????[/QUOTE] Read the announcement Ezzaral left you along with the links from that link. Also read this. [url]http://catb.org/esr/faqs/smart-questions.html[/url] One, code tags. [noparse] [code=JAVA] // code here [/code] [/noparse] Two, format your code so it's readable. Code tags don't help much without indentation. Three, …

Member Avatar for javaAddict
0
167
Member Avatar for cmick56

Code tags please. And try not mix spaces and tabs. it doesn't look good when posting since a tab here is 8 spaces. [noparse] [code=cplusplus] // paste code here [/code] [/noparse] [code=cplusplus] #include <iostream> #include <iomanip> using namespace std; void displayAll(int a[]) { int i=0,n=0; for (i=0;i<60;i++) cout << "="; …

Member Avatar for Ancient Dragon
0
142

The End.