عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 01-01-2011, 12:02 AM   #3

CrEaTiVe4ever

كلمة المستحيل ممنوعة عندي

الصورة الرمزية CrEaTiVe4ever

 
تاريخ التسجيل: Jul 2010
التخصص: IT ..
نوع الدراسة: إنتظام
المستوى: السابع
الجنس: أنثى
المشاركات: 362
افتراضي رد: الى الاخوان والاخوات .. مساعدة حل لاب البرمجة ضروري جدا

المشاركة الأصلية كتبت بواسطة a7af مشاهدة المشاركة
خلاص مشكورين جت معي .
المشاركة الأصلية كتبت بواسطة a7af مشاهدة المشاركة

بالنسبة للحوسبة انا عند با جابر وقلنا الاختبار بكرة بس شابتر 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 XAint YBint XBint YB)
    {    
int result;

        
result sqrt((XA-XB)*+ (YA-YB)*2) ;

        return(
result);

    }

    
int DISPLAY_AREA int Widthint high )
    {
        return((
Width *high));

    }

    
int main (void)

{
    
int XAYAXBYBresult;
    
int Areawidthhigh ;

    
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 XAYB,  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 Widthhigh );

    
printf("The area = %d \n",Area )
    
printf("Press any key to end ...");

    
getch();

    return(
0);




هوا فيه أخطاء بس شوف الفكرة


مهموم والله

مشكور ماقصرت والله .. جزاك الله كُل خير ..

بس لا تضيع وقتك ما أحتاجو دحين ..

روح ذاكر وراك كويز وعليه درجات أهم من انو تصحح الكود وأحفظو في الجهاز وماأطل فيه الا يوم الإختبار ..

مُوفقين :) ..

see ya


 

توقيع CrEaTiVe4ever  

 

قال تعالى: [وَذَكِّرْ فَإِنَّ الذِّكْرَى تَنفَعُ الْمُؤْمِنِينَ]
*
[قُلْ يَا عِبَادِيَ الَّذِينَ أَسْرَفُوا عَلَى أَنفُسِهِمْ لَا تَقْنَطُوا مِن رَّحْمَةِ اللَّهِ إِنَّ اللَّهَ يَغْفِرُ الذُّنُوبَ جَمِيعًا إِنَّهُ هُوَ الْغَفُورُ الرَّحِيمُ]

*
[فَقُلْتُ اسْتَغْفِرُوا رَبَّكُمْ إِنَّهُ كَانَ غَفَّارًا يُرْسِلِ السَّمَاء عَلَيْكُم مِّدْرَارًا وَيُمْدِدْكُمْ بِأَمْوَالٍ وَبَنِينَ وَيَجْعَل لَّكُمْ جَنَّاتٍ وَيَجْعَل لَّكُمْ أَنْهَارًا]


 

CrEaTiVe4ever غير متواجد حالياً   رد مع اقتباس