zeroliken 79 Nearly a Posting Virtuoso

could you explain what your program is supposed to do? some comments on particular lines would be nice

...just a note, always have a return 0; statement at the end of int main to properly stop the execution, it might work without it on linux but the code should be able to be compatible on all compilers

zeroliken 79 Nearly a Posting Virtuoso

and what do each those println show?

Edit: Anyway I think JamesCherrill's reply might suit best for your needs, you should have said that you were reading a file in the first post so I could have posted a more concise reply :)

zeroliken 79 Nearly a Posting Virtuoso

like what I said my last post

Then could you post your code so we may see how you did it

we'll find out whats wrong if you post your code

| and : have it's own special character like endline

not really I was able to pull it off without a special character

zeroliken 79 Nearly a Posting Virtuoso

Then could you post your code so we may see how you did it

zeroliken 79 Nearly a Posting Virtuoso

what do you mean by

desplay record is in row i want it in column.

display the output vertically?
you need to be more elaborate about this

zeroliken 79 Nearly a Posting Virtuoso

Then it must be my computer? :[

Did you solve it?
in case not yet, try using using cout statements for all the variables at all parts of the code to know where the problem is by knowing which of these variables is giving garbage value.
try it before and after the initializations and at the end of the functions

zeroliken 79 Nearly a Posting Virtuoso

use "wb" and "rb" for writing and reading in data files

zeroliken 79 Nearly a Posting Virtuoso

hmm..I tried running the program and I was able to successfully get the sum and average? did you compile and saved the changed code?

zeroliken 79 Nearly a Posting Virtuoso

Thank you!

I am having trouble with:

int nn = begin;

	while(nn < end)
	{
	  nn++;
	  sum += nn;
	  avg = sum/nn;
	}

is there something I am missing or have incorrect?

could you explain the "trouble" with it
...if it's the average put avg = sum/nn; after the loop

zeroliken 79 Nearly a Posting Virtuoso

you forgot the

and use nn in the loop condition instead

while(nn < end)
zeroliken 79 Nearly a Posting Virtuoso
int nn = begin;

put this outside the loop and use nn in the loop condition instead

zeroliken 79 Nearly a Posting Virtuoso

will only run if I enter the biggest number first, & it's suppose to be smallest first.

which variable are you talking about?
plus could you explain your operation

zeroliken 79 Nearly a Posting Virtuoso

did you download the appropriate header files?

zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso

at line 32
try it like this

cin >> word; //receive input for word
cin >> number; //receive input for number

or simply

cin >> word >> number;

then at line 33 call the function print (word, number);

zeroliken 79 Nearly a Posting Virtuoso

The second function should take a string and an integer as arguments, and print out the string as many times as the integer.

what exactly did you put in that function? Did you use a loop?

void print (string word, int number)
{
        /*create loop that will print the following string as many times as the integer passed*/
	cout << word << endl; // display the string
}
zeroliken 79 Nearly a Posting Virtuoso

It will give us a better idea if you could post your current code here or are you just asking for suggestions on this?

zeroliken 79 Nearly a Posting Virtuoso

I think its python, its a bit easier to learn the language and write the code compared to Java and C++

zeroliken 79 Nearly a Posting Virtuoso

TaxDeduc method does return a value but you dont seem to properly call the method itself
instead in your main method the variable is assigned as a float
these links should help you
http://www.tutorialspoint.com/java/java_methods.htm
http://www.wikihow.com/Call-a-Method-in-Java

dij_0983 commented: nice links +2
zeroliken 79 Nearly a Posting Virtuoso
void howMany(int count1, int count2, int count3 )

then print their values in the function

zeroliken 79 Nearly a Posting Virtuoso

The code should be fine.

Those red lines found at the rightmost side of netbeans says otherwise
try to fix those issues before running the right file

PS. next time just attach the image on your post so we can view it at the thumbnail

zeroliken 79 Nearly a Posting Virtuoso

create the necessary arguments at your howMany function for it to work

zeroliken 79 Nearly a Posting Virtuoso

You made Duplicate posts at the C and C++ forums and I received 3 private messages from you with the very same topic
You could have just made a single thread and waited patiently for a response from one our members

@AD
there's a [ at the end of your code

zeroliken 79 Nearly a Posting Virtuoso
public Thread1(String name, int len, String a[], String b[]) 
thr[0] = new Thread1( tt , baseLength, aa, bb);

A String cannot be converted to a String[] by method invocation conversion

zeroliken 79 Nearly a Posting Virtuoso

you need to put the main method and all your methods inside your public class

private Container getContentPane() {
throw new UnsupportedOperationException("Not yet implemented");
}
}

the last bracket here ends your public class
and don't put ); after the end brackets

*next time wrap your code in code tags so we can just point out what line you got the error

zeroliken 79 Nearly a Posting Virtuoso
char a[100000];

maybe you meant to use an array of integers since your just using numbers?

zeroliken 79 Nearly a Posting Virtuoso

The ascii value of E is 69 and A is 65
so more or less the its like

printf("%s",p + 69-65);

when simplified it will look like

printf("%s",p + 4);

this will print out the characters from 2 up to 1 (2011)

zeroliken 79 Nearly a Posting Virtuoso

Does that mean you've finished your program and have no more questions... if so then you mark this thread as solved
oh and next time don't forget to wrap your codes in code tags to make it more presentable and readable in your posts :)

zeroliken 79 Nearly a Posting Virtuoso

at the function at Line 142 , the bracket after return 0; ends just the while loop resulting in main and other functions inside the function at said line

Xenix-Hero commented: This helped me a LOT! I missed that one when searching through. +0
zeroliken 79 Nearly a Posting Virtuoso

Well you're current code is swapping only the values inside an 1 array only?
Maybe a good sorting algorithm will help you clear some things out
note: you can find more better examples if you search on google

zeroliken 79 Nearly a Posting Virtuoso

for (a = 0;j< size-1; j++)

Did you already fix this? like DJSAN10 suggested

zeroliken 79 Nearly a Posting Virtuoso

F6 runs your main project
Try using Shift + F6 to run the java file on the current screen

zeroliken 79 Nearly a Posting Virtuoso

Try what I suggested a while ago

Left click on payroll.java on the Projects tab at the left side of netbeans then click run file

zeroliken 79 Nearly a Posting Virtuoso

I think your running javaapplication5 class instead of payroll class
...judging from the image

Edit: If your figuring this out...Left click on payroll.java on the Projects tab at the left side of netbeans then click run file
... or simply Shift + F6 :)

zeroliken 79 Nearly a Posting Virtuoso

Java is case sensitive
so that should be "Public class payroll" not Payroll

either change the file name's first letter to uppercase or the public class name's first letter to lowercase

zeroliken 79 Nearly a Posting Virtuoso

the whole program is commented out...
put */ at the line after the author

zeroliken 79 Nearly a Posting Virtuoso

Could you explain your problem and your code more clearly...
What exactly is the output you want to achieve?
Can you give us an idea of what you want to do next or are you asking for suggestions for what to do next?

zeroliken 79 Nearly a Posting Virtuoso

following songokute's post, they're already in an array of strings(for every line that is)
you could use a loop to check

for(int i =0; i < State.length ; i++)
    System.out.println(State[i]);
zeroliken 79 Nearly a Posting Virtuoso

but I don't know how to loop back again to my "main screen" after an action has been done by the user.

You could simply put the whole menu in a while loop that runs while choice is not equal to 4(the exit in your code)

zeroliken 79 Nearly a Posting Virtuoso

It doesn't show any of those errors when I try to compile it in netbeans 7.1?

maybe you could try printing it like this

System.out.println( "For the Department " + departName );
System.out.println( "With this number of employees " + employees );
System.out.println( "And with this average salary: " + avgSalary );
System.out.println( "The weekly total payroll is " + totSalary );
zeroliken 79 Nearly a Posting Virtuoso

When you use a variable without passing it by reference to the function doesn't give it a new value when you return to main

for example:

printf("The new salary is %.2f\n",sum);

You never assigned a value to sum at main just because you assign a value to it from a function it doesn't mean it will retain the value when it returns to the main function since you did not pass it by reference

ns=pay*percent;

same can be said here, percent has no value at float get_new_salary function

try to pass the variables percent and sum to the functions you use them in order to assign them a value

zeroliken 79 Nearly a Posting Virtuoso

you could also try to print out the value of i while incrementing it to see the changes that happens and its current value for yourself

zeroliken 79 Nearly a Posting Virtuoso

i am having an error while executing this statment..

That said if you want us to look deeper into the problem you can post your code and describe what the error is

zeroliken 79 Nearly a Posting Virtuoso

simple way to check if a JButton is not Enabled

isEnabled() would return false if the button is not enabled and true if otherwise
Isn't that enough to know that the button is not enabled?

stultuske commented: why go easy if you can go the hard way ... thought this post would solve the thread, but hey :) +12
zeroliken 79 Nearly a Posting Virtuoso

Here's an guide and example on How to Write a key Listener from Oracle to give you more info about Key Listeners

zeroliken 79 Nearly a Posting Virtuoso

There are lots of basic java examples and definitions of a term on the web if you try to search
If you have problems in understanding or couldn't figure out an error in your code then you can ask here for help

zeroliken 79 Nearly a Posting Virtuoso

Yep I can see the sponsor badge when i hover over your avatar so I'm positive that your payment got through

zeroliken 79 Nearly a Posting Virtuoso

Could you post the current output of the program and then your desired output

zeroliken 79 Nearly a Posting Virtuoso

# and determine if the number is divisible using the modulus operator.

modulus returns the remainder of a number
ex.

>>> 10%4
2
>>> 10%2
0

if the answer is 0 then the number is perfectly divisible
this should give you a hint if the number is prime

zeroliken 79 Nearly a Posting Virtuoso
if (input > 0 || input > 8 || input.hasNextInt())

Like what stultuske said hasNextInt() can only be used in a scanner object
("in" in your code is a scanner object )
Also maybe you meant input < 8
But this method won't work for non numeric input

How about using regex like in this thread
Re: Input Check (Int or not)