import java.util.Scanner;
public class Arrays
{
public static void main( String [] args)
{
int [] weight = {30,150,305,225,135,160,80,200,165,90,100,120};
String [] people = {"Anne","Bob ","Ralph","Tim ","Barbara","Jane","Steve","Tom ","Mike","Shirley","Pam ","Frank"};
for (int i=0;i<weight.length;i++)
System.out.println(people[i] + "\t\t" + weight[i]);
int i = 0;
int tweight= 0;
while(tweight <1100)
{
tweight += weight[i];
i++;
}
System.out.println();
System.out.println( "Number of people: " + i + " With total weight: " + tweight);
}
}
the elevators in our building have an 1100 lb. load limit. Determine which people in the list above get on the elevator. Print their names, weights, total weight, and how many got on.
what is some advice to make that happen.
all im printing is the total weight.
im guessing my brain is freezing up from trying to figure this out.
i dont want anyone to do it for me.
i just need advice.

New Topic/Question
Reply




MultiQuote










|