Question: 1. Write a method public void printInOrder( int a, int b, int c ) that takes as its arguments three integers and prints them out
1. Write a method
public void printInOrder( int a, int b, int c )
that takes as its arguments three integers and prints them out in increasing order (i.e., the smallest first)
2. Write a method
public void printAgeGroup( int age )
that takes an integer age as its argument and prints one of the following messages to the console depending on the value of age:
print "infant" if age is equal to 1
print "toddler" if age is equal to 2 or 3
print "preschooler" if age is equal to 4
print "kindergartener" if age is equal to 5
print "elementary age" if age is equal to 6, 7, 8, 9 or 10
print "middle schooler" if age is equal to 11, 12 or 13
print "high schooler" if age is equal to 14, 15, 16, or 17
print "too cool" if age is equal to 18 print "old" if age is greater than 18
3. Write a method
public int findSmallest( int [ ] array )
that returns the smallest element in the provided array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
