Part I: Print out the two arrays: (Be sure to do this first) Anne 30 Bob 150 Ral
ID: 3625602 • Letter: P
Question
Part I: Print out the two arrays: (Be sure to do this first)
Anne 30
Bob 150
Ralph 305
Tim 225
Barbara 135
Jane 160
Steve 80
Tom 200
Mike 165
Shirley 90
Pam 100
Frank 120
Part II: 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.
NOTE: You may hard code the data into the arrays and print the answers on the screen
REMEMBER: When you code a method, it should do one, and only one process, such as print the array, sort the array, or find how many people got on the elevator. Code a separate method for each of these processes. The client code (main) can then call the proper method in the order he/she needs them.
--------------------------------------------------------
Explanation / Answer
Dear, Part1: Method print that displays all names and weight. The function header contains two paramaters 1.Object array of class Person and size void print(People list[],int n){
for(int i=0;i<n;i++)
{
System.out.println(list[i].Name+" "list[i].Weight);
}
} Hope this will help you Hope this will help you