01-01-2011, 12:02 AM
|
#3
|
كلمة المستحيل ممنوعة عندي
تاريخ التسجيل: Jul 2010
التخصص: IT ..
نوع الدراسة: إنتظام
المستوى: السابع
الجنس: أنثى
المشاركات: 362
|
رد: الى الاخوان والاخوات .. مساعدة حل لاب البرمجة ضروري جدا
بالنسبة للحوسبة انا عند با جابر وقلنا الاختبار بكرة بس شابتر 5 و 7 واختبار الاثنين 5 و 7 و 8
__
معليش اذا في امكانية هذا سؤال جاء لسكشن اخر وفي اختلاف بسط ياليت لو احد يحله .. والله يوفقكم .
• A header functions to calculate DIST. Write a C program that calculates and displays the distance DIST (type double) between two points A and B of the plane which the coordinates (XA, YA) and (XB, YB) are entered by keyboard as an integer by using:
• A header functions to calculate the Area of the triangle (AREA)
DIST = square root ((XA-XB)2 + (YA-YB)2)
AREA=(Width *high)/2
|
نفس الشيء بس تزود الـarea
زي كدا يعني ..
كود PHP:
#include <stdio.h> #include <math.h> #include <conio.h>
int DISPLAY_DIST ( int XA, int YB, int XB, int YB) { int result;
result = sqrt((XA-XB)*2 + (YA-YB)*2) ;
return(result);
}
int DISPLAY_AREA ( int Width, int high ) { return((Width *high));
}
int main (void)
{ int XA, YA, XB, YB, result; int Area, width, high ;
printf("Please enter the coordinates of A and B to calculate the distanc :\n " ); printf(" XA = "); scanf("%d \n" , &XA); printf(" YA = "); scanf("%d \n" , &YA); printf(" XB = "); scanf("%d \n" , &XB); printf(" YB = "); scanf("%d \n" , &YB); result = DISPLAY_DIST ( XA, YB, XB, YB);
if (XA >= 0) && (YA >= 0) && (XB >= 0) && (YB >= 0) { printf(" The distanc equal %d \n" ,result); } else if (XA < 0) && (YA < 0) && (XB < 0) && (YB < 0) { printf("Erorr ! \n"); printf("Try againe ...\n "); }
printf("Also please enter the width and high to calculate the area :\n"); printf("Enter the width > \n "); scanf("%d", &width); printf("Enter the high > \n"); scanf("%d", &high); Area = DISPLAY_AREA ( Width, high );
printf("The area = %d \n",Area ) printf("Press any key to end ...");
getch();
return(0);
}
هوا فيه أخطاء بس شوف الفكرة
مهموم والله
مشكور ماقصرت والله .. جزاك الله كُل خير ..
بس لا تضيع وقتك ما أحتاجو دحين ..
روح ذاكر وراك كويز وعليه درجات أهم من انو تصحح الكود وأحفظو في الجهاز وماأطل فيه الا يوم الإختبار ..
مُوفقين :) ..
see ya
|
|
قال تعالى: [وَذَكِّرْ فَإِنَّ الذِّكْرَى تَنفَعُ الْمُؤْمِنِينَ]
*
[قُلْ يَا عِبَادِيَ الَّذِينَ أَسْرَفُوا عَلَى أَنفُسِهِمْ لَا تَقْنَطُوا مِن رَّحْمَةِ اللَّهِ إِنَّ اللَّهَ يَغْفِرُ الذُّنُوبَ جَمِيعًا إِنَّهُ هُوَ الْغَفُورُ الرَّحِيمُ]
*
[فَقُلْتُ اسْتَغْفِرُوا رَبَّكُمْ إِنَّهُ كَانَ غَفَّارًا يُرْسِلِ السَّمَاء عَلَيْكُم مِّدْرَارًا وَيُمْدِدْكُمْ بِأَمْوَالٍ وَبَنِينَ وَيَجْعَل لَّكُمْ جَنَّاتٍ وَيَجْعَل لَّكُمْ أَنْهَارًا]
|
|
|
|