![]() |
Hey guys looking for some Java help
Im coding this application and I cant figure out how to make the last bit to work. It asks for user input in a loop until they do not want to input any more entries, it should then use the entered data to calculate a total and averages.
From what i have it just uses the last entry from the loop and not the entire loop. Any help would be appreciated, thanks! To sum up the program will: * Ask whether the consultant is a partner (y/n) * Asks for employee hours * Calculate the total cost for the employee * Output the Employee type, Employee Hours and Employee Cost * Repeat if desired Then it will: (heres where im having trouble) *Tabulate the total number of employees * Tabulate the total project cost * Calulate the average hours per employee * Calculate the average project hourly billing rate and output it to the console. Code:
|
Re: Hey guys looking for some Java help
anyone? The problem seems to be with my variables. I need to have a set of variables that are used for each individual employee, and then a set of overall variables that track all the various totals. But I cant figure out how to set that part up.
|
Re: Hey guys looking for some Java help
Ok, I'm a C guy, so correct any syntax errors. I'm sure this is what you ment to do. I created an additional variable called employeeCost which is added to totalCost at the end of each while loop. And I moved averageHours and averageBilling out of the loop.
Like I said, I did not compile this, good luck. Code:
|
Re: Hey guys looking for some Java help
toxicjn thanks for your reply, this is exactly what had to be fixed,
i actually did finally figure this with the help of a buddy before i had returned to check this post lol. but again thanks! |
| All times are GMT -5. The time now is 10:31 PM. |
Powered by: vBulletin Version 3.0.3 |