I posted this in the codeguru forum, but I decided to post here, because this is a forum specified for java, and it appears that users are active, so this will be the main java forum i use. All help is apprecieted
Here is the assignment: You are planning to transport a large number of people on a trip. You have 45-passenger buses and 16-passenger vans at your disposal. Any bus you use must be completely filled, and any remaining passengers transported by van.
You must write a Java program that returns the necessary numbers or each type of vehicle given the number of students to be transported. There should be methods to determine the number of buses, the number of vans and a main method to test them.
Here is what I have done so far:
Error i recieve: cannot find symbol - variable buspublic class bAndV{ public static void main (String args[]) { System.out.println (bus(151)); System.out.println (vans()); } public static int bus(int bus){ return bus/45; } public static int vans(int vans){ int rem = bus % 45; if (rem % 45== 0) return (0); else return ((rem/16)+1); } }
What must I do for the second method to identify bus as a variable from the first method? Thank you for the help.