(Celsius to Fahrenheit conversion) Write a program that displays a table of temperatures from 0C to 20C and their Fahrenheit equivalents. The formula for converting from the Celsius scale to the Fahrenheit scale is
F= (9/5) C + 32
where F is the temperature in Fahrenheit and C is the temperature in Celsius. DEVAMINI OKU »
(Perfect Numbers) A positive integer is called a perfect number if it is equal to the sum of all of its positive divisors, excluding itself. For example, 6 is the first perfect number because 6=3+2+1. The next is 28=14+7+4+2+1. There are four perfect numbers less than 10000. Write a program to find all these four numbers. DEVAMINI OKU »
(Occurrence of max numbers) Write a program that reads integers, finds the largest of them, and counts its occurrences. Assume that the input ends with number 0. Suppose that you entered 3 5 2 5 5 5 0; the program finds that the largest is 5 and the occurrence count for 5 is 4. DEVAMINI OKU »
(Geometry: two rectangles) Write a program that prompts the user to enter the center x-, y-coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the first. (You must use Scanner class to get input from user.) DEVAMINI OKU »
(Geometry: point in a rectangle?) Write a program that prompts the user to enter a point (x,y) and checks whether the point is within the rectangle centered at (0,0) with width 10 and height 5. For example (2,2) is inside the rectangle and (6,4) is outside the rectangle. (Hint: A point is in the rectangle if its horizontal distance to (0,0) is less than or equal to 10/2 and its vertical distance is less than or equal to 5.0/2.) DEVAMINI OKU »
(Compute the area of a triangle) Write a program that reads three edges for a triangle and computes the perimeter if the input is valid. Otherwise display that the input is invalid. The input is valid if the sum of every pair of two edges is greater than the remaining edge. (You must use JOptionPane class to get input from user.) DEVAMINI OKU »