775 Posted Topics
![]() | Re: the second break stops the current loop it's in so it should return to the first loop "Why not try it yourself to see what happens, you can use print statements to see where the program is heading" |
Re: print all the values of the array so you can see what happened | |
Re: Don't make a [URL="http://www.daniweb.com/software-development/cpp/threads/406463"]Duplicate post[/URL] | |
Re: To me it depends on my mood, importance and focus at night... Iv'e experienced not sleeping for a whole night just to program and some nights I don't feel like typing at all :P | |
Re: Are you at least familiar with arrays? Here's a link from the API [URL="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html"]Arrays[/URL] | |
Re: it will only loop as long as the necessary conditions are met in the while statement to continue the loop also the first else if condition cannot happen, you cant have a value less than or equal to 2 and at the same time greater than 5 | |
Re: %d is an integer format specifier. in the code you posted it refers to the integer values of passed and failed I don't think we can explain this better from the links posted by thines01 and JamesCherrill | |
Re: [CODE]if (ans == "begin")[/CODE] you can use strcmp from string.h library | |
Re: try [URL="http://www.winprog.org/tutorial/"]Forger's win32 API tutorial[/URL] | |
Re: [QUOTE]What is currently more used ? java ? c++ ?[/QUOTE] Here's a link to a thread that has a link to the top 20 list of languages (by usage) [URL="http://www.daniweb.com/community-center/it-professionals-lounge/threads/400855"]Programming language list[/URL] As of this month c++ has moved to 4th place while java remains to be first | |
Re: Maybe its because you have negative reputation points or 0 points to Affect Someone Else's Reputation ...just my guess | |
Re: [QUOTE=subith86;1731320]the function pow() returns double. So you can use double to hold the value. [CODE] using namespace std; int main() { double i; i = pow(2,1000); cout<<i<<endl; //prints 1.07151e+301 i = i*4; cout<<i<<endl; //prints 4.28603e+301 i = pow(i,((double)1/1002)); cout<<i<<endl; //prints 2 return 0; } [/CODE][/QUOTE] this is the [B]c[/B] forum … | |
Re: [QUOTE=cscgal;1731278]Hold your suggestions for just a bit longer :) I'm currently working on recoding all of DaniWeb from scratch, and there's a complete freeze on the existing system right now.[/QUOTE] Good luck on that then ![]() | |
Re: [CODE]char level;[/CODE] its suppose to be an integer if your gonna use it in your switch case | |
Re: This is somehow similar with your other post... Did you check if the PrelogApp class is in the same directory and in the same package? | |
Re: This is the community Introduction forum Post your thread in this forum [URL="http://www.daniweb.com/hardware-and-software/microsoft-windows/windows-vista-and-windows-7/38"]Windows Vista and Windows 7[/URL] | |
Re: @ lines 29 and 86 you check if the first input is hexadecimal... you should check the value of the second input use str2 instead of str [QUOTE]I'm sorry its not in English and if this bothers anyone I can translate the code into english[/QUOTE] If you still have problem … | |
Re: From your other thread... [QUOTE=zeroliken;1731335]Are you at least familiar with arrays? Here's a link from the API [URL="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html"]Arrays[/URL][/QUOTE] [QUOTE=stultuske;1731371]well, you may want to check out [URL="http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html"]this link[/URL]. normally, I would direct you to the array tutorials on the Oracle site, but I seem to have trouble loading the page. On … | |
Re: [QUOTE=Ms New to Java;1731321]HI im a student and our professor asked us to convert a number into word: example: input= "1" output="one" i need to have numbers from 1-10,001 so my program will end up very long if i only use if else statement i know that there are other … | |
Re: In short... In your main function you never assigned a value to multiplication but you try to show its value in line 15 [CODE]printf("Multiplication of the first %d elements of the array is %d\n", n, multiply_array_elements(ar1, n, multiplication));[/CODE] It won't work since variable multiplication has no value [QUOTE]But, when I … | |
Re: Why do you need array "n" in the first place? Can't you assign numbers to the 2d array without it | |
![]() | Re: Save the the sentence to a string variable then use setText() , then convert the non String variables to string and do the same method a bit similar to what you done here only thing difference is you'll be storing the output to a string variable beforehand [CODE]// textArea1.setText(String.valueOf(df.format(monthlyPayment)));[/CODE] ![]() |
Re: [QUOTE]Is it that exit(10); has no role in the code?[/QUOTE] when you use return it tells a function to return execution of the program to the calling function and its value, all code that comes after that will be ignored [QUOTE]And is the function actually printing anything[/QUOTE] you can try … | |
Re: If you already have an Operating System or any program in the computer you bought then that will take up some space already or some of the memory may be reserved the memory it takes up is not always 101% accurate... in my opinion anyway | |
Re: I think it's a top-down parser It starts at the top of the program which is line 1 right? | |
Re: Here's a link to a read me thread in the Computer Science forum [URL="http://www.daniweb.com/software-development/computer-science/threads/19933"]Programming FAQ[/URL] There's topic there concerning c and c++ [QUOTE](i can make some basic games and programs, like snake game)[/QUOTE] For basic console games I suggest c Though if you want to create complicated games(3d) I suggest … | |
Re: Well I learned Java with javac command prompt which gave me a basic idea of how java works When I moved on to netbeans(IDE) I felt more relaxed as it made coding easier as it provided suggestion, corrections, shortcuts etc. I suggest that beginners should learn java with simple command … | |
Re: here's a link for [URL="http://c-overview.blogspot.com/2007/08/nested-loop.html"]Nested Loops[/URL] and for [URL="http://c-overview.blogspot.com/search/label/Array%20in%20C%20Language"]arrays[/URL] You'll be surprised that you can learn a lot more when you search the net [QUOTE]am really getting problem[/QUOTE] If you have problem in the code you can post it here so we can help | |
Re: [QUOTE=kikic;1730201]It is useful for me, if you write me, code in C++ for this task, and I translate in assembly... Please help me if you know, it is very important[/QUOTE] People here will give you suggestions to help you but I don't think that anyone will do the work for … | |
Re: [QUOTE=polasikat;1730279]Create a program that displays the numbers that divide evenly into all the numbers from a given starting and ending number by the user. Class name is Divisibility Sample output Starting number:1 Ending number: 1 1 is divisible by 1 2 is divisible by 1 2 3 is divisible by … | |
Re: [CODE]if(timesshot != 45); { //... }else{ if(timesshot == 45); { //... } }[/CODE] try to remove the semicolons in your if statements Now why make an "if(timesshot == 45)" statement when you already have an else statement (@ the "if(timesshot != 45)" statement) for that very purpose? | |
Re: Also don't forget to wrap your codes in code tags and properly indent it cause it's an eyesore | |
Re: [CODE]typedef struct{ //there is no space in typedef char name[66]l int no; }re; main(){ //I suggest you use int main //rest of your code here } [/CODE] Don't declare the structure inside the main function declare it outside and above from the main [CODE]can[0].name="xx"; can[1].name="yy";[/CODE] you cannot simply assign one … | |
Re: Do you mean that you want to remove all of the values in the linklist? you can use the remove() on all the indexes | |
Re: [CODE] #include <iostream> //#include <stdio.h> #include <string> using namespace std; int main (void) { using std::string; string letter; cout << "Enter a letter: "; //use printf() instead of cout cin >> letter; //use scanf() instead of cin if (letter == "a") { cout << "aqua" << endl; } if (letter … | |
Re: to change JButton size: ButtonName.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); | |
Re: `void randomizeArray(int array*, int arraySize) //should be *array` just correcting trivial details :) | |
Re: [QUOTE=adityatandon;1726740]Ummm.. why is void main() wrong ? U can always use void main, it just indicates main isnt returning anything! Drawbacks, if any, please do list out, even I'd like to know.. As mentioned above, sort the array using the first alphabet of every string... eg : compare passengerName[1][0],passengerName[2][0] etc … | |
Re: [QUOTE=mKorbel;1727152]Happy New Year 2012 from Continental Europe[/QUOTE] thread title doesn't connect with the description I could downvote this thread for breaking a rule on using clear and relevant titles for new threads :twisted: but I don't feel like it ;) Anyway have a prosperous new year mKorbel ;););) | |
Re: [CODE]System.out.println("Enter SSN: "); SSN[i] = s.nextInt(); System.out.println("Enter Last Name: "); Lname[i] = s.nextLine();[/CODE] [QUOTE]Enter Last Name: <--- JUMPED![/QUOTE] when you inputted the number, you’re unintentionally leaving a trailing a newline behind. The newline you left there is then captured instantly upon reaching the next s.nextLine() read here for more info: … | |
Re: Could you post your code so we can see how you implemented your formula | |
Re: [QUOTE=metronomu;1720712]You must DECLARE the function before using it. In this case you only DEFINED it after you used it. The compiler won't let you use it unless you at least DEFINE it before you use it. Search more and learn about defining and declaring functions and variables. In your case … | |
Re: well <iostream.h> and <conio.h> are old and deprecated libraries It's better when you use a modern library like <iostream> also since you didn't bother to wrap the code in code tags it's hard to tell if you did a good job | |
Re: neither scanf() nor getchar() will "see" any input from the 'ESC' key. It doesn't generate a 'character' from the perspective of C's i/o library. | |
Re: [QUOTE=adityatandon]cout<<i<<" + "<< n-i<<" = "<<n;[/QUOTE] This is the C forum not C++ Translation: [CODE]printf("%d + %d = %d",i,(n-i),n);[/CODE] also don't do the OP's work for him... it's not your homework let him learn by himself, we're only here to guide/teach him | |
Re: [QUOTE]the problem i am facing is that i dont know how to match each students answers with the correct answer.this has to be done with dynamic arrays. Help me in this:[/QUOTE] Compare each of the values using a loop As for all the students You could initialize the student and … | |
Re: @HacruLeian please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL] before posting You should have started your own thread instead of hijacking this thread How would you feel if suddenly someone else posted a new question in your thread which made users ignore your own question I Hope that a mod will move the previous … | |
Re: It's a lot better to ask the teacher who gave you the assignment for clarifications Are you suppose to [B]generate[/B] a flow chart from your code? try [URL="http://www.ezprog.com/"]AutoFlowchart[/URL] Are you suppose to [B]create/show[/B] a flow chart from your code? try using [URL="http://www.winprog.org/tutorial/"]Forger's[/URL] to create a window that will graphically show … | |
Re: Make a [URL="http://www.java-samples.com/showtutorial.php?tutorialid=236"]String Tokenizer[/URL] program and set the delimiters to characters other than the alphabets |
The End.