الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ارجوا المساعده لخبراء ال ++

بدأه bombark في 20 يناير 2009 · 2 رد · 616 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه

++ابي احول هذا الكود إلا كود ال

/* Main */

// variable declaration

double labWeight, hqWeight , firstExamWeight , secondWeight , finalWeight ,

AhmedTotal , MohammadTotal ,AliTotal, SamiTotal KareemTotal;



// take values from user keyboard :

labWeight = (from keyboard);

hqWeight = (from keyboard);

firstExamWeight = (from keyboard);

secondWeight = (from keyboard);

finalWeight = (from keyboard);



// take files from the file :

// Ahmed 

AhmedTotal = (labWeight/100 .0) (from file) + (hqWeight/100 .0) (from file) + (firstExamWeight /100 .0) (fromfile) + (secondWeight /100 .0) (from file) +

(finalWeight /100 .0) (fromfile);

// Mohammad

MohammadTotal = (labWeight/100 .0) (from file) + (hqWeight/100 .0) (from file) + (firstExamWeight /100 .0) (fromfile) + (secondWeight /100 .0) (from file) +

(finalWeight /100 .0) (fromfile);

// Ali

AliTotal = (labWeight/100 .0) (from file) + (hqWeight/100 .0) (from file) + (firstExamWeight /100 .0) (fromfile) + (secondWeight /100 .0) (from file) +

(finalWeight /100 .0) (fromfile);

// Sami

SamiTotal = (labWeight/100 .0) (from file) + (hqWeight/100 .0) (from file) + (firstExamWeight /100 .0) (fromfile) + (secondWeight /100 .0) (from file) +

(finalWeight /100 .0) (fromfile);

// Kareem

KareemTotal = (labWeight/100 .0) (from file) + (hqWeight/100 .0) (from file) + (firstExamWeight /100 .0) (fromfile) + (secondWeight /100 .0) (from file) + (finalWeight /100 .0) (fromfile);





// Maximum Grade :

double max = AliTotal;

String maxName = “Ali”;

if(max < AhmedTotal){

max = AhmedTotal;

maxName = “Ahmed”;

}

else if (max < KareemTotal ){

max = KareemTotal;

maxName = “Kareem”;

}

else if (max < SamiTotal){

max = SamiTotal;

maxName = “Sami”;

}

else if (max < MohammadTotal){

max = MohammadTotal;

maxName = “Mohammad”;

}

print (“The Heighest Grade :” + maxName );



// call printStarsFunction (out of main) 

Print Line (“Weighted Score Chart”);

printStarsFunction(“Ahmed” , AhmedTotal);

printStarsFunction(“Mohammad” MohammadTotal);

printStarsFunction(“Sami” , SamiTotal);

printStarsFunction(“Kareem” , KareemTotal);

printStarsFunction(“Ali” , AliTotal);



/* End of Main */



void printStarsFunction(String s , double grade){

print Line (s);

for(int i = 1; i<= grade; i++ ){

print(“*”);

}

printLine(“”);

}

تم تعديل هذه المشاركة بواسطة time1 في 20 يناير 2009 في 06:59 — السبب: تنسيق الكود

#2

وضح اخي المقصود من سؤالك

llback.jpg

اشهد ان لا إله إلا الله وان محمدا ً رسول الله

#3

هذه سيناريو لبرنامج يقتصر على جمل الادخال والاخراج .. بسيط وليس فيه تعقيد اخي bombark ..

لا اعلم ماهي المشكله التي تواجهك هنا ؟

ان كان غرضك هو الحل مباشرة فهذا ممنوع هنا اخي الحبيب على حد علمي .. الا في حال عرضت مشاركتك لعل وعسى ان يستطيع احد ان يقدم لك العون ..

بالتوفيق

--------

سبحان الله , الله اكبر , ولله الحمد

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…