Ask your own question, for FREE!
Computer Science 19 Online
Shuki:

Can someone check my code? I need to make sure it works. System.out.println(" Give me five numbers."); for (int i=1; i<=5; i++){ System.out.println("Enter a number this is number this is number " +i+":"); list1.add(input.nextInt()); } System.out.println("this is the list" + list1); Integer smallest = list1.get(0); Integer largest = 0; for (Integer e : list1){ if (e > largest){ largest=e; } if (e < smallest){ smallest=e; } } System.out.println("smallest values "+ smallest); System.out.println("largest values "+ largest); ArrayList even = new ArrayList (); ArrayList odd = new ArrayList (); int sum = 0; for(int depo : list1) { if(depo % 2 == 0) { even.add (depo); } else{ odd.add (depo); } sum += depo; } System.out.println("even values "+ even); System.out.println("odd values "+ odd ); System.out.println("total values "+ sum); } } https://replit.com/join/ttumvtjy-shunaco

TETSXPREME:

how are we supposed to do that ?

Shuki:

Click the link

imqwerty:

paste it somewhere where we don't have to login in to see it use: https://p.ip.fi/

Shuki:

blocked

imqwerty:

💀

Shuki:

yeps, but thanks. Im sorry I didnt know you would have to login in

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!