السلام عليكم
كيفكم شباب و صبايا
بليز عندي سؤالين في الجافا
و محتاجة مساعدتكم في الحل:
1. Sphere
Design and implement a class called Sphere that contains instance data that represents the sphere's diameter. Define the Sphere constructor to accept and initialize the diameter, and include getter and setter methods for the diameter. Include methods that calculate and return the volume and surface area of the sphere (Volume= 3/4 π r3 , area = 4 π r2 ). Include a toString method that returns a one-line
description of the sphere. Create a driver class called MultiSphere, whose main method instantiates and updates several (at least 5) Sphere objects.
2- Leap Year
Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is to determine if the year is a leap year(and therefore has 29 days in February) in the Gregorian calendar. A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400. For example, the year 2003 is not a leap year, but 2004 is. The year 1900 is not a leap year because it is divisible by 100, but the year 2000 is a leap year because even though it is divisible by 100, it is also divisible by 400. Produce and error message for any input value less than 1582 (the year the Gregorian calendar was adopted).
3. Simple Calculator
Write a program that will evaluate simple expressions such as 17 + 3 and 3.14159 * 4.7. The expressions are to be typed in by the user. The input always consist of a number, followed by an operator, followed by another number. The operators that are allowed are +, -, *, and /. Your program should read an expression, print its value, read another expression, print its value, and so on. The program should end when the user enters 0 as the first number on the line.
