2,827 Posted Topics
Re: "What I don't like about (insert ethnic group here) is (insert reason here)." No matter what you put in the blanks, people are going to have a negative reaction and it's going to detract from whatever point you are trying to make, so if you actually HAVE a point and … | |
Re: I imagine that the answer to the OP's question is what Ancient Dragon somehow accidentally posted in post 1: [quote] Hello Why not compile with DevC++ and then just run the exe file? To run the file in cmd, just go to the directory where it's located and type the … | |
Re: Well, yes, it is full of errors, and keep in mind that sometimes when something is full of errors, the part you are having a hard time with may NOT be the error. The function you are worried about seems fine to me save for one thing: [code] string Date::convertMonthNumberToString(int … | |
Re: You have a j variable declared in line 6 and a j variable declared in line 24. These have different scopes. Be very careful with this. You are also passing j to functions outside of what is posted. Check to make sure j isn't passed by reference and that the … | |
Re: [QUOTE=DIDL;928867]but there is for 3D, but i want for begin in 2D, can someone give me something were i can learn or work easy with it....?[/QUOTE] Vague questions are likely going to give you answers that don't fit what you want because people don't KNOW what you want. You need … | |
Re: Please include all import statements with the posted code so we don't have to add them ourselves. I see no call to this function: [code] public void actionButtons() { for (int i = 0; i < buttonsName.length; ++i) { paintButtons[i].addActionListener(this); } [/code] No Action Listeners are ever added to the … | |
Re: [QUOTE=_dragonwolf_;922942]I have tried different things to modify the following code and have been unsuccessful. The following code is to get the julian date number. I need to alter it to make it return the day number (between 1 - 366) within a given year. Can anybody help? (fyi - this … | |
Re: Function call must match the function declaration. Your function takes two parameters: [code] void arrSelectSort(double*, int); [/code] so you need to give it a double* and an integer when you call it on line 84 (line 4 in most recent post): [code] arrSelectSort(array, size); [/code] Leave off the [ICODE]double*[/ICODE] and … | |
Re: // payroll program upgrade import java.util.Scanner; // program uses scanner public class payroll5 { public static void main(String args[]) { Scanner input = new Scanner(System.in); String nameOfEmployee; double rateOfPay; rateOfPay = 0; double hours; double sum; System.out.println("Please enter name of employee or stop to quit: "); nameOfEmployee = input.nextLine(); while … | |
Re: I'm getting a "Debug assertion failed" error in Visual Studio in the loop in lines 79 and 80. Note: I had to change the code in line 42 from "Contributor.h" to "contributor.h" to match the filename. [code=cplusplus] //*************************************************************** // TITLE: Contributor // FILEInContrib: Contributor.cpp // PREPARED FOR: CS230 Section <section … | |
Re: [code=cplusplus] int flipLocation(int numberUsed) { cout << "Enter flip location "; cin >> flipLocation; if (flipLocation > numberUsed) cout << "Invalid flip location"; cout << "Enter a new flip location "; cin >> flipLocation; return flipLocation; }[/code] I see lines 6 through 8 are indented. I assume that means they … | |
Re: Bubble sort is the simplest sort algorithm out there. Google "bubble sort", "bubble sort c++", "bubble sort c++ sample code", stuff like that, and you'll get plenty of sample code, all based on arrays. Here's a bunch of applets I made myself explaining the different sorts. I really need to … | |
Re: I don't see where you're doing any conversion. You say you're converting to decimal. Is there an integer variable that holds the decimal? you have temp, but I assume that's just a temporary variable. What holds the final decimal value? I also don't see any initialization of the bitset that … | |
Re: I think I see the logic, but I'm not 100% sure. I see no reason why you are not placing the [ICODE]i++ [/ICODE] in your outer loop or why you would want it inside your inner loop. Your job, it seems to me, is to go through chrs[] a character … | |
Re: You should post a short, complete program, including the array display function, the read_list function, and the main function that calls both. Throw in some comments describing the variables and what they represent. There could well be a problem in calling or displaying the array rather than a problem with … | |
Re: [code] void line_test::isvalidname(ifstream& input,ofstream& output) { if(input>>first_name>>ws>>last_name) { output<<"name "<<inputline2<<"\n";//"name "<<inputline2<<"\n"; } else if(input>>idnumber) { output<<"id "<<inputline2<<"\n";//"id "<<inputline2<<"\n"; } else if(input>>gpa) { output<<"gpa "<<input<<inputline2;//"gpa "<<inputline2<<"\n"; } else if(input>>gender) { output<<"gender "<<inputline2<<"\n";//"gender "<<inputline2<<"\n"; } else { output<<"none"<<"\n"; } } [/code] Don't know what you are trying to do here, but I … | |
Re: [quote] hi all, this is my first time using JAVA. i know other programming languages, such as, c++, PHP, Assembly. [/quote] This is your first time using Java and you're writing a 1500 line program? What happened to starting with "Hello World"? It's an awful lot of code to work … | |
Re: [code=cplusplus] //This finstion will round value from calculated line 6 //and will return a number rounded to nearest multiple of 1000 double round(double calcTotStat)// parameters for function { double roundCalc; calcTotStat += .5; roundCalc = (int) (calcTotStat / 1000); roundCalc * 1000; return (roundCalc); // return to main } [/code] … | |
Re: Close on the code tags. Here's how to do it: [code] paste code here [/code] You need a loop to check each element of the array individually. #include <iostream> using namespace std; int main() { int board[3][3] = {0,0,0,0,0,0,0,0,0}; // check if board is all zeroes bool allZeroes = true; … | |
Re: [QUOTE=aveek;922808]i am trying to draw an arrowhead at the mid point of a line. say the point is (x,y). can anyone tell me how to do this. the line could be curved. it should also point toward either of the end points[/QUOTE] "Arrow" or "arrowhead"? This sounds like a contradiction. … | |
Re: [QUOTE=debasishbasak;922805]pls help me to convert 2 dimensional array into 1 dimensional in c++ code[/QUOTE] You don't need two threads for the same question. Close one of them. This is a fairly easy task, but you need to post an attempt first, even if it is incorrect. At least post some … | |
Re: [QUOTE=loozax;921976]can some1 help me wid diz?! [code]import java.io.*; public class looping1{ public static void main(String args[])throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader (System.in)); int value = 1; for (int i = 1; i<=11;i++ ){ System.out.println(value); value = i + value;} }} [/code] the output should be: 1 2 4 … | |
Re: This is a cut and paste of the assignment specification. What is the question? [url]http://www.daniweb.com/forums/announcement9-2.html[/url] | |
Re: Close on the code tags: [code=JAVA] paste code here [/code] import java.io.*; import java.util.*; public class GraphPath { static BufferedReader input; static PrintWriter output; private static int numNodes; private static int matrix[][]; public static boolean deBug = true; public static boolean deBug2 = false; public static void main(String [] args) … | |
Re: [QUOTE=thr;920187]please help me[/QUOTE] He IS helping you. He's asking you questions in an attempt to clarify your goals. Depending on your answers to those questions, he'll offer different advice. Often, if you answer these questions, not only will the problem be clearer to him (and the rest of us), but … | |
Re: You're asking two questions when one question will suffice, so I would say it's overkill. Ask either of these: [quote] Input largest value to square : [/quote] or [quote] Input largest squared value : [/quote] but not both because one derives from the other. Frankly I think the first question … | |
Re: We can help, but we won't do it all for you. You need to also put your pattern in code tags so the spacing isn't stripped out. Otherwise, we can't tell what the pattern is supposed to be: [code] paste pattern here [/code] | |
Re: [QUOTE=thr;920131]i want to select java or c# please help me to select better programming language and easy to programming language i have experience in c++ if java is better please tell me why java is better or c# please introduce me best books for java and c#[/QUOTE] You're in the … | |
Re: [QUOTE=whiteyoh;895901]Thanks for the replies. Interesting to know theres still more than 1 way to skin a cat. Im using netbeans. im after an example of something that gives me an understanding of how clicking a button interacts with an access database to add,edit,delete a record and outputs everything to a … | |
I posted a program earlier today in response to another thread and noticed that I had forgotten to clean up/free the memory I used. Here's the program. [code=cplusplus] #include <iostream> using namespace std; int main() { int LIST_SIZE, NUM_CHARS_PER_ELEMENT; cout << "Enter number of elements in list: "; cin >> … | |
Re: [QUOTE=tazboy;919967]Without vectors, I need it to be a dynamic array using new. So would it be: [ICODE]char **list = new char[LIST_SIZE];[/ICODE] or [ICODE]char **list = new *char[LIST_SIZE];[/ICODE] If this is true then I would need to have my function return [ICODE]char **read_line[/ICODE] , correct?[/QUOTE] Is list type char* or type … | |
Re: [QUOTE=masterjiraya;919980][CODE=JAVA]// This is the Debts program in Java import java.io.*; class Debts { public static void main(String[] args) throws IOException{ BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); String Amount, Payable, Interest, Paid; double Value, Rate, Spent; int Years; System.out.print("Enter Amount: "); Amount=stdin.readLine(); Value=Double.parseDouble(Amount); System.out.print("Enter Payable in years: "); Payable=stdin.readLine(); Years=Integer.parseInt(Payable); System.out.print("Enter Intrest Rate: … | |
Re: I've had numerous problems with repaint () and they used to drive me nuts. I won't claim to understand the ins and outs, but I've gotten better. They have tended, for me at least, to boil down to my not using threading properly. Here is a thread that I started … | |
Re: [QUOTE=loozax;918947]im just new here..and i really need some1 who can help me do our exercises..its about java(using looping/iteration)..i know others in java but not yet 'bout looping..[/QUOTE] You aren't getting help because you aren't showing effort yet. It's the policy on this forum (and just about all forums) that posters … | |
Re: Well we can't run the code since it refers to other things. Your goal is to catch and handle problems in the way you want. It's catching things correctly (not letting bad input go by the point where you think the bad input is), but it's not handling it the … | |
Re: I tried my hand commenting on this thread earlier, but after reading my own post, I decided that my comments just made things more confusing, so I didn't post. So my contribution to this thread will be to link a previous thread that I started when I wanted to get … | |
Re: Wherever you need to set aside memory and you have no idea how much memory you'll need at compile time, you'll probably need a "new" command. Whenever you have a "new" command, you'll need a "delete" command somewhere. A decent rule of thumb, but definitely only a rule of thumb … | |
Re: As I mentioned in your last thread, you need to define what an "invalid" answer is and what a "valid" answer is. It looks like you have decided to use regular expressions to do this, which is a good idea, but again, you and only you can decide what's "valid" … | |
Re: [QUOTE=akulkarni;916718]i am not getting the desired output(the contents in a text file which i have saved in the jdk bin here is my code i got. Also what is return in the try catch block i wanna know. it says file not found [code] import java.io.*; class FileDemo { public … | |
Re: Function call: [code] temp.getstockNumber(j -1); [/code] Function: [code] public int getstockNumber() [/code] Function doesn't take a parameter. Function call provides a parameter. That doesn't match. Try changing the call to: [code] temp.getstockNumber(); [/code] All these errors appear to be the same. You have a bunch of functions that don't take … | |
Re: I assume you are referring to line 18. It should evaluate true if [ICODE]file[/ICODE] is "somefile.tar", false if it is "somefile.txt"? Since no one is going to enter "*.tar", '*' is not meant to be a literal character. Perhaps check if ".tar" occurs in [ICODE]file[/ICODE] using [ICODE]strstr[/ICODE] from the cstring … | |
Re: [QUOTE=BestJewSinceJC;914214]After a little research I discovered some Calendar methods that were pretty nice. [CODE=Java]Date date = new Date(); int daysSinceSeen = - ( rand.nextInt() % 365 ); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, daysSinceSeen);[/CODE] How could this code be returning a date in 2010? Do I have a bug that … | |
Re: [QUOTE=AirGear;914245]can we compile b.cpp by running a.cpp? i have koolplot project to draw plot. this plot should appear in the middle of the program, and if the plot is closed, the whole program terminates immadiately. To avoid that, i tried to make 2 cpp files. One for the main, and … | |
Re: [QUOTE=funjoke88;914781]when is the recursion information ?i didnt see it .u know how to do[/QUOTE] He has two posts linking each other. You keep clicking on them and you keep going back to where you started. It's an infinite loop. If M.C. Escher was alive, he'd paint hundreds of monks mindlessly … | |
Re: [QUOTE=JohnPhilipps;915125]Good evening, I have the need to learn how to make a picture jigsaw with java. I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with. Would somebody have … | |
Re: [QUOTE=rizillion;914278]the problem is that I need to open this tab from another form. [/QUOTE] I don't know why that would be a problem. If you are able to see the JTabbedPane, and it sounds like you can, can't you do this in your ActionListener? [code] tx.setSelectedIndex(1); [/code] Maybe I'm not … | |
Re: You're doing factorials or you're factoring? I'm seeing you use the modulus operator on 10, which suggests you're trying to isolate digits? 200! is way too big for an integer, so I assume you're doing something with arrays to bump up your storage or something, and doing manual multiplication through … | |
Re: Code tags: [code] paste code here [/code] You have no newlines, so everything will be on one line. Is a trapezoid all on one line? No, so you need newlines in there. And do you have enough information to draw a trapezoid? You ask for one dimension. Look at the … | |
Re: [QUOTE=aveek;913065]im trying to draw a curved line using mouse. there are three points on a straight line. a starting point, an ending point and a point in between. i want to draw a curved line by dragging the middle point in any direction. the other two points remain constant.[/QUOTE] Three … | |
Re: If you specify a LayoutManager for panel, your clock drawing will become visible. Below, GridLayout is specified. It's not a good choice for you (BorderLayout would be better, I think), but your clock is at least visible. You'll need to add an import for GridLayout at the top. [code] /** … |
The End.