Test2
and save your class in a file named
Test2.java
.
submit 1020 Test2 Test2.javaYou may submit your solution more than once. Additional documentation about the
submit
command can be viewed by typing man submit
.
Enter a positive integer:The entry has to be made on the same line as the prompt.
Here is a sample run (including the integer entered by the user):
Enter a positive integer: 8
Person
objects and print them (that is, print their names). The API of the
Person
class can be found here.
Here is a sample run (including the output and input of the earlier phases as well):
Enter a positive integer: 8 Peter Daniels Paul Star Ringo Cribb Ringo Cribb Ringo McCarty Paul Cribb Peter Daniels Ringo Lennon
The average age is
followed by the computed average age.
The average age should be given with two digits precision.
Here is a sample run (including the output and input of the earlier phases as well):
Enter a positive integer: 8 Peter Daniels Paul Star Ringo Cribb Ringo Cribb Ringo McCarty Paul Cribb Peter Daniels Ringo Lennon The average age is 44.32
Here is a sample run (including the output and input of the earlier phases as well):
Enter a positive integer: -2 Enter a positive integer: 0 Enter a positive integer: 8 Peter Daniels Paul Star Ringo Cribb Ringo Cribb Ringo McCarty Paul Cribb Peter Daniels Ringo Lennon The average age is 44.32