عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 20-11-2011, 08:33 PM   #3

deathpain

devkemo

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

 
تاريخ التسجيل: Dec 2010
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: Computer Science
نوع الدراسة: إنتظام
المستوى: الثامن
البلد: جــــدة
الجنس: ذكر
المشاركات: 770
افتراضي رد: Cpcs 202 شروحات وحلول وواجبات الجافا

المشاركة الأصلية كتبت بواسطة spider مشاهدة المشاركة
الكود



كود PHP:
import java.util.scanner;

public class 
test
{
    public static 
void main(string[] args)
    {
        
int lowestscore 100 /* make it max score first */averagescore 0counter 1;
        
string loweststudentname "";
        
scanner input = new scanner(system.in);
        
        
system.out.print("enter the number of students: ");
        
int studentscount input.nextint();
        if(
studentscount <= 0system.exit(0);
        
        while(
counter <= studentscount)
        {
            
input.nextline(); // to discard "\n"
            
            
system.out.print("enter student " counter " name: ");
            
string name input.nextline();
            
            
system.out.print("enter student " counter " score: ");
            
int score input.nextint();
            
            if(
score lowestscore)
            {
                
lowestscore score;
                
loweststudentname name;
            }
            
averagescore += score;
            
counter++;
        }
        
        
averagescore /= studentscount;
        
system.out.println(loweststudentname " has the lowest score (" lowestscore ") and the average score is " averagescore);
    }

الله يعطيك ألف عافية ويا ليت تشرح لنا الحل إذا تقدر ؟

 

توقيع deathpain  

 



في حال وجود أي استفسار أو سؤال حول الجافا CPCS202 الرجاء كتابة استفسارك مباشرة في موضوعي هنا:

تطبيق - معدلي الجامعي - التطبيق الأسهل لحساب المعدل الجامعي
http://skaau.com/vb/showthread.php?t=745520

 

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