Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. P1G
  2. import java.lang.Math;
  3. import java.util.*;
  4. public class P1G{
  5. public static void main (String [] args){
  6. int[10] myArray = [];
  7. for(int index = 0, index <= my.Array.length, index++)
  8. {
  9. myArray[index]=Math.random(-100-100);
  10. }
  11. int index = 0; int postives;
  12. while (index<= myArray[index])
  13. {
  14. if(myArray[index]>=0)
  15. System.out.println(myArray[index]);
  16. index++
  17. }
  18. System.outprintln("positives"+" "+positives);
  19. }
  20. }
  21.  
  22. P1E
  23. public class P1E{
  24. public static void main (String [] args){
  25. String[]favesongs= {"Shut it Down," "Beauty and a Beat, "Begin."};
  26. String[]favemovies= {"Clueless" "Bring It On: All or Nothing" "Legally Blonde"}
  27. for(int index= 0; index < myArray.length; index++)
  28. {
  29. System.out.println(movies[index]);
  30. }
  31. System.out.println();
  32. System.out.println();
  33. Int index = 0;
  34. While(index<myArray.length)
  35. {
  36. System.out.print(songs[index]);
  37. index++;
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement