CSI 1390

Assignment 3

Due Date: 13 November 2006

Question 1

Write a Java program that reads a positive integer and returns the number of digits in that integer. For example: the number 3678 has 4 digits.

Question 2

Mr. Brown has given a test to his class.  He would like to know the average score for the class, and the highest and lowest scores.  Write a java program to calculate and print out these values.  The program must read the number of students from the user.

Question 3

Write a Java program that tells the user whether a number is prime number.  (Hint: A prime number can only be divided by itself and one.  There are no other factors.

Question 4

Write a Java program that tells if a number is palindrome.  (A palindrome number is a number that is the same written both forward and backward, such as 81318).

Question 5

 Write a java program to find the average miles per gallon on a car after six fillups at a gas station.   The program should ask the user about the number of gallons of gas at each fillup, the starting odometer reading, and the odometer reading at each fillup.