68 426
Assignments Done
98,6%
Successfully Done
In December 2018

Answer to Question #41347 in Java | JSP | JSF for solomon

Question #41347
store six of your friend's age in a single array. Assign the ages in a random order. Displaye ages, on reverse order.
Expert's answer
import java.util.Random;
public class Age {

public static void main (String agrc[]) {
Random rand = new Random();
int[] ages = new int[6];

for ( int i = 0; i < 6; i++ ) {
ages[i] = rand.nextInt(80);
System.out.println ( ages[i] );
}
System.out.println ( "Reversed" );
for ( int j = 5 ; j >= 0; j-- ) {
System.out.println ( ages[j] );
}

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions