public class variousArrays
{
public static void main (String[] args)
{
System.out.println ("*****CLASS SCHEDULE*****");
String[] classes = {"Pham", "Wason", "Henninger", "Cardoza", "also Cardoza", "Bartolotti"};
for (int i = 0; i < (classes.length); i++)
{
System.out.println ("Period " + i + ": " + classes[i]);
}
System.out.println ();
System.out.println ();
System.out.println ("*****MOVIES*****");
String[] titles = {"Dr. Horrible's Sing-Along Blog", "Memento", "Serenity"};
String[] directors = {"Joss Whedon", "Christopher Nolan", "Joss Whedon again"};
String[] stars = {"Neil Patrick Harris", "Guy Pearce", "Nathan Fillion"};
for (int i = 0; i < titles.length; i++)
{
System.out.println ((i + 1) + ". " + titles[i]);
System.out.println ("Directed by: " + directors[i]);
System.out.println ("Starring: " + stars[i]);
System.out.println ();
}
System.out.println ();
System.out.println ();
System.out.println ("*****LOTTERY*****");
int a = ((int) (Math.random () * 9) + 1);
int b = ((int) (Math.random () * 9) + 1);
int c = ((int) (Math.random () * 9) + 1);
int d = ((int) (Math.random () * 9) + 1);
int e = ((int) (Math.random () * 9) + 1);
int f = ((int) (Math.random () * 9) + 1);
int[] lottery = {a, b, c, d, e, f};
System.out.print ("The winning numbers are: ");
for (int i = 0; i < lottery.length; i++)
{
System.out.print (lottery[i] + " ");
}
}
}
{
public static void main (String[] args)
{
System.out.println ("*****CLASS SCHEDULE*****");
String[] classes = {"Pham", "Wason", "Henninger", "Cardoza", "also Cardoza", "Bartolotti"};
for (int i = 0; i < (classes.length); i++)
{
System.out.println ("Period " + i + ": " + classes[i]);
}
System.out.println ();
System.out.println ();
System.out.println ("*****MOVIES*****");
String[] titles = {"Dr. Horrible's Sing-Along Blog", "Memento", "Serenity"};
String[] directors = {"Joss Whedon", "Christopher Nolan", "Joss Whedon again"};
String[] stars = {"Neil Patrick Harris", "Guy Pearce", "Nathan Fillion"};
for (int i = 0; i < titles.length; i++)
{
System.out.println ((i + 1) + ". " + titles[i]);
System.out.println ("Directed by: " + directors[i]);
System.out.println ("Starring: " + stars[i]);
System.out.println ();
}
System.out.println ();
System.out.println ();
System.out.println ("*****LOTTERY*****");
int a = ((int) (Math.random () * 9) + 1);
int b = ((int) (Math.random () * 9) + 1);
int c = ((int) (Math.random () * 9) + 1);
int d = ((int) (Math.random () * 9) + 1);
int e = ((int) (Math.random () * 9) + 1);
int f = ((int) (Math.random () * 9) + 1);
int[] lottery = {a, b, c, d, e, f};
System.out.print ("The winning numbers are: ");
for (int i = 0; i < lottery.length; i++)
{
System.out.print (lottery[i] + " ");
}
}
}
(0) Comments
Post a Comment