احتاج الى مساعده بالجافا
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: التعامل مع الشبكات Java Networking
صفحة 1 من اصل 1 • شاطر
احتاج الى مساعده بالجافا
اولا السلام عليكم
احتاج لمساعدة لدي اختبار بعد ساعتين من الان اختبار بالجافا درست سنة أولى I.T وثم اكملت الدراسه C.S
ولكن لم اتمكن من اللحاق ببعض المحاضرات بالجافا بسبب التشديد بالمطارات اتاخرت بالسفر والان احتاج لبعض المساعده فضلا منكم لمن يقدر ان يساعدني لا يبخل
وتحياتي لكم من اليمن
ملاحظه طريقة الاختبار ستكون كالاتي هذه هو سنبل الاختبار
صفحه ١
Sample ExamII CSCI300 - Fall 2020
Part I: Implement the following classes
Consider the following UML diagram for an application that manages spheres in the 3D space.
Question 1:
Create the class Point
Implement the no-arg and all-arg constructors.
Implement the calculateDistance method that returns the distance between
two points.
Implement the isEqual method that returns true if all coordinates are equal in both
points and false otherwise.
Implement the toString() method. If x=2.0, y=3.5, and z=4.0, then the method
returns a string in the form: (2.0, 3.5, 4.0)
Question 2:
Create the class Sphere
Implement the two constructors.
The no-arg constructor should initialize the color to “black”, the radius to 1.0,
and the center to (0.0, 0.0, 0.0).
Implement the getCenter method that returns the center of the sphere. Don’t
implement the rest of getters and setters.
Implement the method calculateVolume() that returns the volume of the
sphere.
Sphere
-radius: double
-center: Point
-color: String
+Sphere( )
+Sphere (radius: double, center: Point,
color: String)
+getCenter( ):Point
+calculateVolume(): double
+isEqual(sphere:Shpere):boolean
+toString(): String
Point
-x: double
-y: double
-z: double
+Point( )
+Point(x: double, y: double, z: double)
+calculateDistance(point :Point) :double
+isEqual(point : Point) :boolean
+toString(): String
صفحه ٢
푉표푚푢푛푓 =
4
3
× 휋 × 푠푎푒푖푢푡3
Implement the isEqual method that returns true if both spheres have the same
center and radius and false otherwise.
Override the toString() method. The method returns a string in the form:
Sphere{Radius:2.0, Center:(1.0, 2.0, 3.0), Color:RD, Volume:33.49333}. Note that
you should only display the first and last letters of the color capitalized.
Part II: Write an application (driver program) for the classes in Part I
Complete the application (driver class) TestSphere as requested below.
Write code to perform the following operations:
a) Create an array of 3 spheres.
b) Ask the user to enter the radius, color, and center coordinates for these spheres:
Create them.
Store them inside the array.
c) Print the information of all spheres (using the toString() method)
d) Print the number of spheres with volume greater than 50.
e) Print whether or not the first and last spheres are equal.
f) Print the distance between the centers of the second and last spheres.
احتاج لمساعدة لدي اختبار بعد ساعتين من الان اختبار بالجافا درست سنة أولى I.T وثم اكملت الدراسه C.S
ولكن لم اتمكن من اللحاق ببعض المحاضرات بالجافا بسبب التشديد بالمطارات اتاخرت بالسفر والان احتاج لبعض المساعده فضلا منكم لمن يقدر ان يساعدني لا يبخل
وتحياتي لكم من اليمن
ملاحظه طريقة الاختبار ستكون كالاتي هذه هو سنبل الاختبار
صفحه ١
Sample ExamII CSCI300 - Fall 2020
Part I: Implement the following classes
Consider the following UML diagram for an application that manages spheres in the 3D space.
Question 1:
Create the class Point
Implement the no-arg and all-arg constructors.
Implement the calculateDistance method that returns the distance between
two points.
Implement the isEqual method that returns true if all coordinates are equal in both
points and false otherwise.
Implement the toString() method. If x=2.0, y=3.5, and z=4.0, then the method
returns a string in the form: (2.0, 3.5, 4.0)
Question 2:
Create the class Sphere
Implement the two constructors.
The no-arg constructor should initialize the color to “black”, the radius to 1.0,
and the center to (0.0, 0.0, 0.0).
Implement the getCenter method that returns the center of the sphere. Don’t
implement the rest of getters and setters.
Implement the method calculateVolume() that returns the volume of the
sphere.
Sphere
-radius: double
-center: Point
-color: String
+Sphere( )
+Sphere (radius: double, center: Point,
color: String)
+getCenter( ):Point
+calculateVolume(): double
+isEqual(sphere:Shpere):boolean
+toString(): String
Point
-x: double
-y: double
-z: double
+Point( )
+Point(x: double, y: double, z: double)
+calculateDistance(point :Point) :double
+isEqual(point : Point) :boolean
+toString(): String
صفحه ٢
푉표푚푢푛푓 =
4
3
× 휋 × 푠푎푒푖푢푡3
Implement the isEqual method that returns true if both spheres have the same
center and radius and false otherwise.
Override the toString() method. The method returns a string in the form:
Sphere{Radius:2.0, Center:(1.0, 2.0, 3.0), Color:RD, Volume:33.49333}. Note that
you should only display the first and last letters of the color capitalized.
Part II: Write an application (driver program) for the classes in Part I
Complete the application (driver class) TestSphere as requested below.
Write code to perform the following operations:
a) Create an array of 3 spheres.
b) Ask the user to enter the radius, color, and center coordinates for these spheres:
Create them.
Store them inside the array.
c) Print the information of all spheres (using the toString() method)
d) Print the number of spheres with volume greater than 50.
e) Print whether or not the first and last spheres are equal.
f) Print the distance between the centers of the second and last spheres.
العريقي١- ..
- تاريخ التسجيل : 21/05/2021
المساهمات : 12
النقاط : 22
التقيم : 0
الدولة :
الجنس :
| |
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: التعامل مع الشبكات Java Networking
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى
أمس في 7:32 pm من طرف moslema_r
» تصميم تطبيق للأسر المنتجة
الأربعاء مايو 15, 2024 10:41 am من طرف mona mohamed
» شركة تنظيف منازل ام القيوين
الثلاثاء مايو 14, 2024 7:50 pm من طرف moslema_r
» شركة تنظيف محلات بالرياض
الثلاثاء مايو 14, 2024 7:34 pm من طرف moslema_r
» تصميم تطبيق مثل حراج
الثلاثاء مايو 14, 2024 9:59 am من طرف mona mohamed
» تصميم تطبيق نقل أثاث
الإثنين مايو 13, 2024 10:30 am من طرف mona mohamed
» افضل شركة تنظيف ستائر بالرياض
الأحد مايو 12, 2024 7:57 pm من طرف moslema_r
» تصميم تطبيق للسوبر ماركت
الأحد مايو 12, 2024 7:22 am من طرف mona mohamed
» شركه مكافحه حشرات عجمان
السبت مايو 11, 2024 9:15 pm من طرف moslema_r
» Harmony of intimacy, uninhibitedness with mutual consent
الجمعة مايو 10, 2024 5:56 am من طرف wdqwd