zeroliken 79 Nearly a Posting Virtuoso

Do you want the name to be related to the product or service of the software company? :)

zeroliken 79 Nearly a Posting Virtuoso

How about creating a Jpanel then add the "add to file" button to it then add the Jpanel to pane that way the size of that button is set

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

Well GridLayout make all cells in the same size, it will not matter much if they have a specified size for now... that said you have to specify a size for its container instead
One of the replies here showing this example might help you
http://stackoverflow.com/questions/2536873/how-can-i-set-size-of-a-button

zeroliken 79 Nearly a Posting Virtuoso

where exactly did you put the code?
could you post the code

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

It depends on the culture and social norm of the company your going to work for

zeroliken 79 Nearly a Posting Virtuoso

No, the edit button is to edit the Employee details within the .txt file. The "Add To File" Button size I want to be preset in the java class.

So that means that you want to set the button size for "Add To File" Button right?
then, still with my earlier post

ButtonName.setPreferredSize(new Dimension(buttonWidth, buttonHeight));

Or maybe I'm still misunderstanding what you really mean,then sorry :$

zeroliken 79 Nearly a Posting Virtuoso

This is my work but I believe I did it wrong
1 {
2 int rNumb[50];
3 input (rNumb);
4 output (rNumb);
5 }

6 int input (int x[])
7 {
8 int i = 0;
9 srand(time(0));
10 for(int i=0; i<50; i++)
11 x = rand()%100+1;
12 return x;
13 }


int output (int x[])
{
int i = 0;
for (int i = 0; i < 10; i++)
{
if (x % 2 == 1)
cout << x << " ";
}
return x;
}

Next time wrap your code it in code tags, it automatically adds number lines
Now for your code...

return x[i];

return statements are not needed, While passing arrays to functions, the address of the array is passed from the calling function. Since the address of the array is always passed to a function, it is easy to alter the contents of the array directly in the called function.

zeroliken 79 Nearly a Posting Virtuoso

remove the semicolon ; on line 45
and write an else statement inside the

else if (genderType=='f' || genderType=='F')

statement after the last else if statement inside it if you want a default output if the name's is not equal either the if and else if statements after it

i mean it prints you are not a male silly goose for any male

well the else statement is the default if neither the name is not equal to any of the names given in the if and else if statements so it prints what it is suppose to print

zeroliken 79 Nearly a Posting Virtuoso

is the image found in the same directory or in the right path?

zeroliken 79 Nearly a Posting Virtuoso

Put the numbers in a 2d array (if you haven't done this yet) then add each element according to their index using a loop and lastly divide it by the total number of items

same method can be applied in getting the average of grades across or from up to down with little changes in the indexes while looping

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

I want the "Add To File" button to be full length (across the GUI)

do you mean that you want to edit the button size?
if so you can use this to change the button size
ButtonName.setPreferredSize(new Dimension(buttonWidth, buttonHeight));

zeroliken 79 Nearly a Posting Virtuoso

I suggest to deal with the errors netbeans found before trying to run it

@override

Read this and maybe search google for more info
http://stackoverflow.com/questions/561365/what-is-override-for-in-java

(btw i have no idia what static and final means)

Still the same,If you doubt their purpose or use you can always search the net on why you need to use them like so
http://docs.oracle.com/javase/tutorial/java/IandI/final.html

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, I keep moving the code blocks around. It does not work.How do I change the gallon variable since all I can do is Input number. Gallon does not have a specific value that is assigned to it.

printf( "Enter gallon used (-1 to end): " );
  scanf( "%d", &gallon);

did you try putting these statements inside the loop....

With all the replies I think enough hint is given already :-/

DeanMSands3 commented: Thanks, ZeroLiken. +3
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

Now this is how formatting would help you. You can clearly see one else is misplaced

int rook_moove(int x1,int x2,int y1, int y2)
	{
		int dx,dy;
		int i,j;
		dx=abs(x2-x1);
		dy=abs(y2-y1);
		if(((dx!=0)&&(dy=0))||((dy!=0)&&(dx=0)))
		{
			printf("Cannot moove- the m oove is illegall!\n");
			return 0;
		}
		else
		{
			for(i=x1+1;i<x2;i++)
			{
				if(check_if_empty(i,y2))
				{
					update_board(x1,y1,x2,y2);
					print_board();
					return 1;
				}
			}
		}
		else
		{
			for(j=y1+1;j<y2;j++)
			{
				if(check_if_empty(x1,j))
				{

					update_board(x1,y1,x2,y2);
					print_board();
					return 1;
				}
			}
		}
	}

More specifically , this is the else

You can't use 2 else statements after an if statement, line 12 should be an else if statement or another if statement after the first else, etc.

I think he just didn't notice it :)

zeroliken 79 Nearly a Posting Virtuoso

The players can play where other players have already played. I tried to use the switch statement at the bottom in method checkMove where if result == false, that spot is taken. But of course, anyone can see that that will not work.

Use a loop instead of just using an if statement that will check if the spot is taken every time either players input a number

zeroliken 79 Nearly a Posting Virtuoso

Are you trying to make a number guessing game like program cause that's the only logical thing I interpreted from what you just posted

zeroliken 79 Nearly a Posting Virtuoso

yeah im using C, because our prof teach only in C, im only a first year college, but i know its only same

i want a program that process the scheduling the LAST COME, FIRST SERVE

your in the wrong forum you should have posted this in the C forum
and no,for C and C++ there's a lot of differences about the two

for example just printing the output...
in C

printf("this is C \n");

in C++

cout << "This is C++" << endl;

And now for your code... just saying "process the scheduling the LAST COME, FIRST SERVE" is not explaining much, so my suggetstions would just be my interpretation of the problem

I think it would be a lot easier if you use an array of structure
then use a loop that will swap the contents of the last element to the first element of a structure until the elements of the whole array has been reversed

zeroliken 79 Nearly a Posting Virtuoso

Your half(50%)? so that proves it. You are not biased at all. LOL :D

I think he means someone who's very close to him... probably his wife

zeroliken 79 Nearly a Posting Virtuoso

*Wrap your codes in code tags*

so what exactly do you want the program to do?
You need to write more details, It will give us and you a hint of what to do next

Also just noted that your using the library stdio.h from C are you sure that your suppose to code in C++ since you posted in the C++ forum?

zeroliken 79 Nearly a Posting Virtuoso

Women or computers? >;-)

(hiding now, in case my other half is reading...)

Both if you've seen enough of either ;)

zeroliken 79 Nearly a Posting Virtuoso

Can't live with them, can't live without them

-What society feels about them and their works

zeroliken 79 Nearly a Posting Virtuoso

And why aren't you allowed?

well you could use a loop that only runs once

but that would be bad programming even it solves the problem but hey

zeroliken 79 Nearly a Posting Virtuoso

Why so hard? :(

Actually stultuske's post is suppose to make the program a lot easier to handle and use

which part are you having problems understanding?

zeroliken 79 Nearly a Posting Virtuoso

http://www.daniweb.com/forums/announcement8-2.html
Sorry but this is not a forum where we provide code
Make an effort and show your code if you need help with it

zeroliken 79 Nearly a Posting Virtuoso

but sometimes it encounters segmentation error.

On what part does the segmentation fault occur?

zeroliken 79 Nearly a Posting Virtuoso

Didn't this post helped you already?

zeroliken 79 Nearly a Posting Virtuoso

What method would I use in order to count the numbers in the output... Like how many 1's and how many 2's etc. etc.

Wouldn't it be much easier if you add 1 to a counter exactly after the generated number

//your number generator code
for (int i = 1; i < 10000; i++) {
                int rand = generator.nextInt(97);
                vect.add(rand);
                vect.add(Math.abs(generator.nextInt()) % 99);

                //use a loop will add number instance to a counter
                for (int j = 1; j < 99; j++) {//iterate 1-99 for the array's index
                    if(vect.get(i)==j)//once found
                        //you add 1 to the array with the same index as j... check stultuske's post 
                }
            }
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

add one more + sign after the variable

System.out.println( "For the " + departName + " Department " );

My advice is don't make Java act like C :)

zeroliken 79 Nearly a Posting Virtuoso

Put the methods before your main and Declare the variable types in your methods

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

C, Java, CSS and HTML
(not sure about the web development languages since its been a long time since I coded one)

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

but when I call the list function the names aren't right but the ID and mark data is correct. For the list function all I do at the moment is print each member in all the structures.

Then could you post the list function

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

For the total sales count, total, and items create a counter where a value is added for every user input.

I was thinking about using a for loop but im clueless as to how i would incorporate it into my program

It's hard to imagine how you want the program to look like when you execute it...
Could post when should it display the total sales count, total, and items and how many times it should be displayed?