Problems Based on ECOO "Java 11 Doc"

The problems below are based on this document: http://www.ecoo.org/jketelaars/java/java11.pdf (PDF -- link no longer working)

2.1.3

Write a program that prompts for two integers a and b and prints the sum, difference, product, integer dividend, and remainder.

2.1.4

Write a program that lets you enter the radius of a circle and that prints both the circumference and the area of the circle.

2.1.5

Write a program that prompts for a temperature in Fahrenheit and that prints the result in Celsius.

2.1.6

Write a program that prompts for a distance in kilometers and prints the distance in miles.

2.1.2a

Write a program that prompts for a string s then prints asterisks the length of that string.

2.1.2b

Write a program that prompts for a width w then prints a tree where the lowest part of that tree is w wide.

To make this easier, only print each "line" of the tree an odd number of asterisks.

Supplemental: if a user enters an even number, bump it up by one (i.e. 4 becomes 5).

2.1.7

Write a program that lets you enter a number of hours, and that converts it to days and hours. For example, 111 hours = 4 days and 15 hours.

2.1.7b

Modify 2.1.7 so it repeats continuously until "0" is entered.

2.1.8

Write a program that prompts for a number of minutes, and outputs the equivalent number of days, hours, and minutes.

2.1.9

Write a program that prompts for the two sides of a right angled triangle and outputs the hypotenuse.

2.1.10

Write a program that prompts for the three sides of any triangle and outputs the area of the triangle using Heron's formula.

2.1.11

Write a program that prompts for an angle in degree and outputs its equivalent in radians.

2.1.12

Write a program outputs the area of a triangle given the length of two sides and the contained angle. (reference)

2.1.14

Write a program that prompts for two numbers a and b and outputs ab.

2.1.15

Write a program that prompts for a number and rounds it off to 3 decimal places.

2.2.1

Write a program that prints the numbers from 1 to 10.

2.2.2

Write a program that prints the numbers from 10 to 1.

2.2.3

Write a program that prints the numbers from 1 to 30 by 2's and then by 3's.

2.2.4

Write a program that prints a conversion table for Fahrenheit to Celsius, from -40F to +100F in 10's.

2.2.5

Write a program that prints a conversion table for Celsius to Fahrenheit, from -40C to +30C in 10's.

2.2.6

Write a program that prints the sum of the 5 numbers that you entered.

2.2.6a

Modify 2.2.6 so it uses an array.

2.2.7

Using an array, write a program that prints the average of 5 numbers that you enter.

2.2.8

Using an array, write a program that prints the largest of 5 numbers that you enter.

2.2.9

Using an array, write a program that prints the smallest of 5 numbers that you enter.

2.2.10

Write a program that prompts for a positive number n then prints out n! (1!=1, 2!=1x2=2, 3! = 1x2x3=6, 4!=1x2x3x4=24, 5! = 1x2x3x4x5=120, etc.)

2.2.11

Write a program that prompts for a positive number n then prints out the nth triangular number.
Comments