DJSAN10 28 Posting Whiz in Training

*POST YOUR CODE USING CODE TAG
*FORMAT YOUR CODE
*POST THE ERRORS THAT THE COMPILER IS GIVING YOU

while(1)

You need to put the opening brace

if(check_if_empty(x2,y2));

What is this for?

for(i=x1+1,j=y1+1;i<x2;j<y2;i++,j++)

Semicolon between two conditions -wrong !!!

There will be many more I suppose. Please follow the above three things, you will get your answers faster

DJSAN10 28 Posting Whiz in Training

Since the error message that you are getting is quite clear, I would suggest you to try the same query on your db console and when it runs there, write the query in your code. Many a times, such things may happen due to case sensitiveness etc.

DJSAN10 28 Posting Whiz in Training

Maybe because

struct mottab //declaring mot table structure
{
char mn[6];
int Class;
char opcode[3];
};

mn[] is of size 6 and ORIGIN is of size 7 including '\0'. Try changing the size of mn and see if it works

DJSAN10 28 Posting Whiz in Training

First of all, use code tag when you post your code.
Secondly, format your code.
And as for your exception, you need to add the jar file of your driver to the path.
What IDE are you using? Or are you doing it via command line.?

DJSAN10 28 Posting Whiz in Training

Post the error that you are getting

DJSAN10 28 Posting Whiz in Training

Just to confirm, you modified the format specifiers in printf as well, right?

DJSAN10 28 Posting Whiz in Training

System multiplication table

Please be a little more specific what exactly you want

DJSAN10 28 Posting Whiz in Training
DJSAN10 28 Posting Whiz in Training

I have this coursework to do and I don't know why my code is not working

What is not working , post in brief. Are you getting an exception somewhere?

DJSAN10 28 Posting Whiz in Training

Also since you are reading a file that contains hexadecimal numbers , it will contain characters from A to F and in fscanf you are reading integers. use %x as format specifier and see if it works

DJSAN10 28 Posting Whiz in Training
if (f==0){
        printf("file doesnt exist?!\n");
     }

f is a pointer. Your if condition should check whether it is null. And if so print the message and exit.

DJSAN10 28 Posting Whiz in Training

What we need to find out here is whether the records are being added to the structure properly in the first place or is there a problem with the printing (list function as zeroliken mentioned). Also when you wrote that printf for testing purposes , was it printing all records properly?

DJSAN10 28 Posting Whiz in Training

Could you paste the entire output that you are getting?

DJSAN10 28 Posting Whiz in Training

Is this an assignment ? Did you try writing any code ?

Anyway, what you can do is ask the user what does he want to calculate ,whether V, I, or R. Take other two values as input from him. Using either if-else or switch you can decide which formula to execute according to what he wants to calculate. That will involve simple multiplication and division.

DJSAN10 28 Posting Whiz in Training

Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted.
Albert Einstein

DJSAN10 28 Posting Whiz in Training

How about using flags for every pattern that occurs. Since you want 'aeiou' order to be maintained , you can have 5 flags for ,say a, ae , aei ,aeio , aeiou. Only if aFlag is true,aeFlag can be true. Only if ae flag is true and you encounter an i, then set aeiFlag to true and so on. When aeiouFlag is set means you got your word. Just an idea, i am not sure if its the best one to follow.

DJSAN10 28 Posting Whiz in Training

First of all ,use code tag whenever you put a code.

As for your solution you need to add an empty implementation of keyTyped() in your class since you have inherited java.awt.event.KeyListener ,you will need to implement all methods specified in it.

DJSAN10 28 Posting Whiz in Training

try a little "google"

DJSAN10 28 Posting Whiz in Training

Ok you are on the right track but you still did not assign anything in the array. negaAr and posiAr contain nothing at this moment . whenever your input < 0, you need to put that input in negaAr and then do nega++.

Also,

if (input<-1)

you will miss -1 here. Either make it <= -1 or make it < 0

DJSAN10 28 Posting Whiz in Training

You are re declaring lettergrade1. You don't need to say string inside your if else blocks. Also , since you only want a single character i.e. A,B,C,D, F ..why not use a char instead

DJSAN10 28 Posting Whiz in Training

There is a slight mistake in what i just wrote. Your will first do the assignment and then increment the counter (Since you counter will be initialized to zero)

DJSAN10 28 Posting Whiz in Training

Your if statement block will contain two things :
1. increment the respective variable
2. assign the number you have just read to the next element of that array (this will be done using the variable you just incremented. That will act as your array index)

DJSAN10 28 Posting Whiz in Training

i dont whats thee problem of this, ihave to input 10 integers and display the number of positive and negative.

This is what you said above.

Anyway, you have taken two arrays one for positive and one for negative numbers. Now , firstly you need to make an assignment to your array. Any positive number encountered should be assigned to the next element of posiAr and similarly for negative. Now the problem with this will be that if you use 'x' as your array index, you might get garbage values in your arrays.
Instead take two counter variables, say posCount and negCount ,initialize them to 0, increment them accordingly on encountering a number, and use that counter as your index in the respective array.

Also when you display your array, loop until you reach the respective count.

DJSAN10 28 Posting Whiz in Training

negaAr[x]; // What's this statement supposed to do? It does nothing.

posiAr[x]; // Same with this one.

What WaltP wants to say is why have you taken an array here? Also you are not doing any computations on it. posiAr and negaAr should not be arrays bt simple integer variables and you need to increment them accordingly ( posiAr++ or negaAr++)

DJSAN10 28 Posting Whiz in Training

Given: 1,1,2,3,5,8,11,19,30,49........
Fibonacii:1,1,2,3,5,8,13,21,...

haha..good catch NormR1

DJSAN10 28 Posting Whiz in Training

Just to give you a start your next number will be the addition of previous 2 numbers

DJSAN10 28 Posting Whiz in Training

Its the fibonacci series. You will find a lot of information about it on the web. Try reading some stuff and start coding. If you are stuck somewhere we will help you.

DJSAN10 28 Posting Whiz in Training

you have probably named your class as RunGame .It should be TestDrive

DJSAN10 28 Posting Whiz in Training

Was there any specific reason IBM decided to start loading BIOS into memory from 640k rather than from the beginning( 0th byte) ?I tried searching on the Internet but did not get a satisfactory answer.

DJSAN10 28 Posting Whiz in Training

You don't give the datatype when you call a function. Your code should be :

sum = count(intArray[i])
DJSAN10 28 Posting Whiz in Training

The later versions of windows have a partition manager program in them but my advice would be to look at some of the partition manager programs on the market. try googling 'partitiomanager' or similiar.
M

You could use GParted. You wil get tutorials on how to use it online

DJSAN10 28 Posting Whiz in Training

Here's another screen recorder software for your understanding. Enjoy...!! :)
http://www.screencast-o-matic.com/

DJSAN10 28 Posting Whiz in Training

Are you running your code in an ide or via command line. Also , check the condition if(conn == null). If it is null it means connection is not being established.

DJSAN10 28 Posting Whiz in Training

Do you get an exception...?? Try finding out whether conn is null. This will confirm whether connection is being established or not in the first place.

DJSAN10 28 Posting Whiz in Training

Unix Error message :

% man: why did you get a divorce?
man:: Too many arguments.

DJSAN10 28 Posting Whiz in Training

Ohh.. i just found it in another thread here itself :D

DJSAN10 28 Posting Whiz in Training

I don't know how many of you all know about this already. But I found this pretty interesting. Check it out :
http://www.gnu.org/fun/jokes/unix-hoax.html

Enjoy..:P :-O :D

DJSAN10 28 Posting Whiz in Training

Surely, while must be used with conditions. I was just giving out one way of doing it. Anyways , you are senior , thanks for your suggestion/correction. :)

DJSAN10 28 Posting Whiz in Training

One more thing, in the default case put an exit() statement so that the user cannot enter more choices. Usually , what you are supposed to do is something like this:
Add 1 more case as follows and use default if a user enters a wrong value

case 5 :
printf ("Exitting");
exit(0);
 
default :
printf ("Invalid choice : Enter a valid choice");

Now your program becomes a little more interactive than before. :)

DJSAN10 28 Posting Whiz in Training

Initially choice = 0, and in the first iteration itself while condition is false. Now here you can use a do while. Also put the switch case inside the while loop as pointed by Sky Diploma

DJSAN10 28 Posting Whiz in Training

The condition tested in a while loop can be any valid C expression. As long as that condition remains true, the while loop will continue. You can create a loop that will never end by using the number 1 for the condition to be tested. Since 1 is always true, the loop will never end, unless a break statement is reached.
Not that while(1) is nothing but an infinite loop which we 'break'. If we don't provide some way of getting out of the loop (like break,goto) , the loop will go on forever.

DJSAN10 28 Posting Whiz in Training

Just another suggestion how you could do it.. (No need of using do while)

while(1)
{
  if(...)
  {

  }
  else if(...)
  {

  }
  else if(...)
  {

  }
  else
     break;
}
DJSAN10 28 Posting Whiz in Training

According to me , what you want is

else if((hari>=2)&&(hari<5))
DJSAN10 28 Posting Whiz in Training

Beacuse your two statements are contradictory :
while(hari < 1)
and
else
break

Make the change that zeroliken just mentioned. Also change your while to while(hari > 1). You will not require the else part also in that case

DJSAN10 28 Posting Whiz in Training

To still answer your question. Above code does not create an object of the given class. You can consider class as a template as to what your object will look like. Using this class you can create an object in some other function (where you wish to use it) . And the function where you create the object will then invoke display() method on that object.

DJSAN10 28 Posting Whiz in Training

Also , the class that contains your main() class should be your filename. Execute that class then.

DJSAN10 28 Posting Whiz in Training

Paste the entire code. Is there an error ? Tell exactly what it is that is not working.

DJSAN10 28 Posting Whiz in Training

When indexOf() does not find the character in the string it returns -1. When you say input.indexOf(i) it means you are trying to find first occurrence of i in the string input. Since this is always false in your case, it always returns -1. Hence -1 is pushed always.

DJSAN10 28 Posting Whiz in Training

stack.push(input.indexOf(i));

This pushes -1 always. indexOf() return first occurrence of character within the string. I think you should be doing stack.push(i);

DJSAN10 28 Posting Whiz in Training

Ok 1 suggestion before I try to look into the problem with your code. See to it that members of your class TestData are private and not public. Write getter() and setter() method to retrieve and set them. Instead of directly using them as someParens.testInput , using the getter method to retrieve them is a much better idea. What you have done is not an error, but it is usually avoided.