Untitled
unknown
plain_text
a year ago
1.9 kB
8
Indexable
//Question 1 Talia // Scanner input = new Scanner(System.in); // System.out.println("Enter number"); // int x = input.nextInt(); // while(x>0) // { // System.out.print(x%10); // x=x/10; // } // Question 2 Talia // for(int i=1;i<=6;i++) { // for(int j = 1; j <= 6; j++) { // System.out.print(i*j+" "); // } // System.out.println(); // } // Question 3 Talia // Scanner input = new Scanner(System.in); // System.out.println("How many students?"); // int num = input.nextInt(); // int grade=0; // int sum; // int counter; // for(int i=1;i<=num;i++) // { // counter=0; // sum=0; // System.out.println("Enter grade for student #"+i+" or -1 to skip to next student"); // grade = input.nextInt(); // while(grade != -1) // { // sum+=grade; // counter++; // grade = input.nextInt(); // } // System.out.println("Student #"+i+" has avg of "+(double)sum/counter); // } // Question 4 Talia Alef // for(int i=0;i<5;i++) { // for (int j = i; j <5; j++) { // System.out.print("* "); // } // System.out.println(); // } // Question 4 Talia Bet // for(int i=5;i>0;i--) { // for (int j = 1; j <=i; j++) { // System.out.print(j+" "); // } // System.out.println(); // } // Question 4 Talia Gimel // for(int i=1;i<=5;i++) { // for (int j = i; j <= 5; j++) { // System.out.print(i + " "); // } // System.out.println(); // }
Editor is loading...
Leave a Comment