Self-Test Questions


Suggested Projects

  1. Weight Guesser Game:   Write a program that guesses the user’s weight. Have them enter their height and age as a starting point. When the program prints a number it should also ask the user if it is too low, too high, or correct. If correct the program terminates.

  2. Number Guesser Game:   Write a program that generates a random number between 1 and 100 and then asks the user to guess the number. The program must tell the user if their guess is too high or too low. Keep track of the number of user guesses and print the statistics when the user guesses the correct answer. Prompt the user to repeat the game and terminate if they enter 'N'. (Hint: Use the java.util.Random class to generate the random numbers.)

  3. Simple Calculator:   Write a program that implements a four-function calculator that adds, subtracts, multiplies, and divides.

  4. Calculate Area of Circles:   Write a program that calculates the area of circles using the following formula:

    image from book

    Prompt the user for the value of r. After each iteration ask the user if they wish to continue and terminate the program if they enter 'N'. (Hint: The java.lang.Math class defines a public static constant for π.)

  5. Temperature Converter:   Write a program that converts the temperature from Celsius to Fahrenheit and vice versa. Use the following formulas to perform your conversions:

    image from book

  6. Continuous Adder:   Write a program that repeatedly adds numbers entered by the user. Display the running total after each iteration. Exit the program when the user enters -9999.

  7. Create Multiplication Tables:   Write a program that prints the multiplication tables for the numbers 1 through 12 up to the 12th factor.

  8. Calculate Hypotenuse:   Write a program that calculates the hypotenuse of triangles using the Pythagorean theorem:

    image from book

  9. Calculate Grade Averages:   Write a program that helps the instructor calculate test grade averages. Prompt the user for the number of students and then prompt for each grade. Calculate the grade average and print the results.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net