Q1: P.234 #16 double num, total=0.0; int count=0; double avg; num = kb.nextDouble(); while(num>=1) { total += num; count ++; num = kb.nextDouble(); } avg = total/count; System.out.println(avg); Q2: Display "Hi CS112" 100 times. refer P.234 #14. int count; for(count=1; count<=100; count++) System.out.println("Hi CS112"); Q3: Display all integers from 100 - 200? int count; for(count=100; count<=200; count++) System.out.println(count); Q4: Sum up all integers from 100 - 200? int count, sum=0; for(count=100; count<=200; count++) sum += count; Q5: Display the average of all integers from 100 - 200? int count, sum=0; for(count=100; count<=200; count++) sum += count; double avg = (double)sum/101; System.out.println(avg); Q6: Sum up all positive inegers from keyboard and stop until a negative number is read. int num, sum = 0; num = kb.nextInt(); while( num > 0 ) { sum += num; num = kb.nextInt(); } Q6: Sum up all negative inegers from keyboard and stop until a zero is read. int num, sum = 0; num = kb.nextInt(); while( num != 0 ) { sum += num; num = kb.nextInt(); } Q7: Read both positive and negative numners from key., and sum up both of them until 0 is read. int num, posSum=0, negSum=0; num = kb.nextInt(); while(num != 0) { if(num > 0) posSum += num; else negSum += num; num = kb.nextInt(); } System.out.println("Pos. Sum = " + posSum); System.out.println("Neg. Sum = " + negSum);