775 Posted Topics
Re: Post your current code so we can see what you've done so far | |
| |
Re: The code you posted is in c++ format and not in standard c format now for assigning... [QUOTE]if (*k==1) *k==0; else *k==0;[/QUOTE] == is used to check if the values are equal = is used to assign a value to a variable | |
Re: Make a main class that calls the methods posted by stultuske Do you know how to use separate classes? | |
Re: > how to sorting this, i've problem to sort by *jum_nilai* from the highest until smallest void lihatData(void) { if(pertama==NULL) printf("Data tidak ada !!!"); else { printf("%3s %-20s %-12s %-5s %-7s %-7s %-5s %-5sn","No","Nama","Jenis K","N Mtk","N B.Ind","N B.Ing","N IPA","Jumlah"); printf("--- -------------------- -------------- ------- ------- ------- ----- -----n"); sekarang=pertama; do { … | |
Re: We can only help you if you help yourself post your code if you have problems with them | |
Re: [QUOTE]The second thing I'm trying to do is have it total the numbers in the array, which are basically {99, 88, 77, 66, 55, 44, 33, 22, 11, 0},[/QUOTE] use a loop that will add the value of the current array index | |
Re: if(moreseats == 88) { System.out.println("You entered 88, no more seats."); } just using a println will not stop operations that should come after it try using a loop then use a break when 88 is entered the problem with the arrays lies within the loops try to trace your code … | |
Re: [CODE]for ( int = 10; i > 0; i--)[/CODE] missing[COLOR="Red"] i[/COLOR] in the declaration [QUOTE]Guys I don't know the output of the following loop please help me out[/QUOTE] I think you should study how loops work before asking questions like these.. the codes you posted are very basic it should … | |
Re: There are tons of exercises on the web if you just search right.. try google search ![]() | |
Re: If the price is fixed you could have just initialized it already e.g. [CODE]private double coffee = 1.00;[/CODE] Now I don't see a method name for the following.. Is this supposed to print the output [CODE]{ System.out.println("Item Name Price"); System.out.println("Coffee $1.00"); System.out.println("Water $2.00"); System.out.println("Milk $1.50"); System.out.println("Bagel $1.25"); System.out.println("Donut $0.75"); }[/CODE] … | |
Re: [QUOTE=pteryx;1715369]The advice by Warburg is a valuable hint, but the WIN32 API funcion ReadConsoleInput waits for a keypress or a mouseclick. It must be supplemented with a wait function. The following function returns zero when nothing was pressed and ASCII code when something "ASCII" was pressed. I hope that this … | |
Re: [QUOTE]So in order to understand the source code !! from where should i start ????[/QUOTE] it depends on the code and the programming language used | |
Re: I completely agree that the boot time windows gets for every version gets worst I just hope that it becomes better for windows 8 regardless of the hardware | |
Re: read here for more info [URL="http://java.sun.com/products/jfc/tsc/articles/timer/"]timer classes[/URL] ![]() | |
Re: First, We don't code for you... we can only help provided you give your code that you need help with Second, if just your just asking for suggestions then you can use arrays and an if statement to compare the letters to their corresponding number..then do the operations required to … ![]() | |
Re: [QUOTE=willleung9;1714441]Can someone please help me?!?![/QUOTE] In what way can we help you Is there an error? I notice in your code that you don't have a constructor function in the code you posted above | |
Re: [QUOTE]3. The else condition is never reached. [/QUOTE] the reason the else statement is never reached is because all the possible outcomes can already be found in the if and if else statement | |
Re: [QUOTE]for( c=0; c <= b; b++){ println("b = " + b);[/QUOTE] Since nothing happens to c it will never be equal to b which is why it loops forever [QUOTE]if(b ==5){ println("loop terminated " + c++); }[/QUOTE] Also since b = 6 it will never be equal to 5 | |
Re: So.... is there a specific error you want to tell? are you asking us for suggestions or instructions? Are you unsure of what to do next? or maybe the code doesn't give the correct output? please specify | |
Re: [QUOTE=The 42nd;1714407]First of all, I don't even know what do you mean by "format the code properly". I used tabs, enters and spaces as much as I can see. What is so improper about it? I could have answered if you had asked a question about the code which is … | |
Re: [QUOTE=J.S.AlKatheeeri;1713964]nope, no one explained this to me before...[/QUOTE] Isn't it your duty to learn or know something like that? | |
Re: [QUOTE=davidname;1713955]is there any simple code for geometric mean...?[/QUOTE] your replying to an old thread...start your own | |
Re: [QUOTE]can you post your code in [ Code ] tags without the extra lines and symbols in? [/QUOTE] Do we have to repeat? | |
Re: [QUOTE=SketchGamer;1713540]My question was HOW to search through an array... I wanted you to tell me so I could apply that knowledge in my game.[/QUOTE] simple... just use a loop pseudo: [CODE]for(int i=0;i<array.length();i++){ if(array[i]==11){ //do something } }[/CODE] | |
Re: then try to find the specific part of the code that gives the unwanted result maybe print each array index one by one | |
Re: your trying to compare an integer(c) and a string(secret) | |
Re: What's this?.. another [B]guess what's wrong with my code[/B] game... huh Not only do you want us to do the work for you, but you did not state how your program works, it's purpose or the desired output. | |
Re: A way to convert from double to int is to use Double.intValue() | |
Re: [QUOTE]I hope you understand me. Otherwise I will try to make it clearer. Thanks[/QUOTE] What you forgot to mention is in what way should we help you | |
Re: to show the user the conversion... Is there a reason for it not to be in the print line? | |
Re: You don't have a process where you save a new value for maxlength in your case maxlength should have a value equal to the current city name that has the most uppercase letters Since the last city name has a length greater than [B][COLOR="red"]0[/COLOR][/B] it will output the last city … | |
Re: help you in what? is there a specific error you want to tell? are you asking us for suggestions or instructions? Are you unsure of what to do next? or maybe the code doesn't give the correct output? please specify | |
Re: you can use edit or delete operations on either the .bin file or .txt file as these only depend on your code Since your teacher told you to use a binary file then your free to use a .bin file if it's a requirement It doesn't really matter which you … | |
Re: So whats the problem with the bounces can you specify your desired output? also you should have used your previous thread instead of creating a new one | |
Re: [QUOTE]I need to print out the scores and the grades when entered and i do not know how to print the scanner. im sure i am probably missing other things as well.[/QUOTE] print the scanner?? or print the variables you used scanner at?? please make it more clear also [CODE]System.out.printf("%s%d%s\n", … | |
Re: [QUOTE]Do not ask for code. We are not a coding service. We will help you fix your code. If anyone posts a complete working solution for you, they are enabling cheaters. If you use that code you are a cheater. [/QUOTE] [URL="http://www.daniweb.com/software-development/c/threads/78060"]Read me[/URL] | |
Re: If you want to print out the exact number of decimal places then manipulate a decimal number between %f [CODE]printf ("%.1f",a); //will print out a with 1 decimal digit[/CODE] | |
Re: [QUOTE]atoi1[0] = rev1[len1]; atoi2[0] = rev2[len2]; atoi1[1] = '\0'; atoi2[1] = '\0'; num1 = atoi(atoi1); num2 = atoi(atoi2);[/QUOTE] what are you trying to achieve here? atoi just converts a string to an integer why put a null terminator at the end? [CODE] int i; char Input [512]; printf ("Enter a … | |
Re: Yes its possible to have a case within a case. Did you compile your work cause I can see a lot of syntax error [QUOTE] scanf("%c", &option);[/QUOTE] In lines 11,50,84,124,157,190,231,298,342,383 Use %s in receiving input [QUOTE]printf("Do you want to find the volume or surface area of the sphere?Indicate by entering … | |
Re: your going to use 2 dimensional arrays Don't expect someone here to give you the immediate answer try coding your work and we'll help you if you have any problems | |
Re: [QUOTE]well yes, I know that. I was rather looking for someone to give me an example of how I could do this. [/QUOTE] You're asking for something thats very basic in Java | |
Re: Isn't declaring a string in c already a null terminated character array? | |
Re: [QUOTE]int mark 1, mark 2, mark 3, mark 4, mark 5, The best 2 highest marks;[/QUOTE] space is not used in variable name declaration [QUOTE]The best 2 highest marks = mark > 50 + mark > 50[/QUOTE] This is not how you use an operation statement [QUOTE]if ( mark > … | |
Re: tokenize the sentence by using space as a delimiter, save each letter in an array then print out the result in reverse | |
Re: [QUOTE]We're supposed to have an array that stores every employee that is created, but i dont know how to create/'name' new employee's on the fly.[/QUOTE] Does scanf on each index on the array doesn't solve your problem? [QUOTE]So my real question I guess is how do i set up my … | |
Re: [QUOTE]printf("%d = %d\n",j,freq[i-2]);[/QUOTE] why are you using you using freq[35998]? I think that integer i your using is supposed to be j. | |
Re: Why not use scanf like this? [CODE]printf("Enter two words: "); scanf("%s",x1); scanf("%s",x2);[/CODE] Also why use a while condition when an if else condition can be enough [CODE]for(i = 0; i < c; i++) { if (x1[i] == x2[i]){ x3[i] = x1[i]; } else break; } printf("%s\n",x3);[/CODE] | |
Re: You could store the number in an array then check each index for the English word you can use an if else condition for every number from zero to nine in comparing |
The End.