2,827 Posted Topics
Re: 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 … | |
Re: [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 … | |
Re: [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] | |
Re: When we finish the assignment, should we post it here or should we submit it directly to your professor? | |
Re: 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] | |
Re: Typo in line 24? [code] public void [COLOR="Red"]pain[/COLOR]Component(Graphics g) [/code] | |
Re: [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. | |
Re: 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, … | |
Re: 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 … | |
Re: [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 … | |
Re: [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] | |
Re: [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 … | |
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 … | |
Re: 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 … | |
Re: [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 … | |
Re: 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. | |
Re: 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 … | |
Re: [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 … | |
Re: 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] … | |
Re: 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 … | |
Re: 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. | |
Re: [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 … | |
Re: 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. | |
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 … | |
Re: 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 … | |
Re: [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 … | |
Re: 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. | |
Re: [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 … | |
Re: [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 … | |
Re: 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. | |
Re: [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 = … | |
Re: [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 … | |
Re: 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. | |
Re: 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)? | |
Re: 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 … | |
Re: "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!". | |
Re: 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 … | |
Re: 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] … | |
Re: 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 … | |
Re: 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] … | |
Re: [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. | |
Re: 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 … | |
Re: 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, … | |
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 … | |
Re: 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 … | |
Re: [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 … | |
Re: [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 … | |
Re: 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. … | |
Re: [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, … | |
Re: 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 << "="; … |
The End.