الموضوع: ابغا حل سؤال .؟
عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 29-11-2014, 07:44 PM

NNOUF NNOUF غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Nov 2014
الكلية: كلية الحاسبات وتقنية المعلومات
التخصص: شبكات وانظمة الاتصال
نوع الدراسة: إنتظام
المستوى: الأول
البلد: منطقة الرياض
الجنس: أنثى
المشاركات: 2
افتراضي ابغا حل سؤال .؟


السلام عليكم
ابغا حل هالسؤالين تكفون
Q1:Write an application that prompts the user for the radius of a circle and uses a
method called circleArea to calculate the area of the circle.
output
Enter the radius (negative to quit): 10
Area is 314.159265
Enter the radius (negative to quit): -1


Q2: Write method distance to calculate the distance between two points (x1, y1) and (x2, y2). All
numbers and return values should be of type double. Incorporate this method into an application that
enables the user to enter the coordinates of the points. Use -88888 as a sentinel value.
Hints:
• The distance between two points can be calculated by taking the square root of
( x2 - x1 )2 + ( y2 - y1 )2

output
Enter X1 (-8888 to stop): 1
Enter Y1: 1
Enter X2: 4
Enter Y2: 5
Distance is 5.000000
Enter X1 (-8888 to stop): -8888
رد مع اقتباس