اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

سؤال في الجافا


loosh

الردود الموصى بها

بسم الله الرحمن الرحيم

انا مبتدأه في لغة الجافا وعندي سؤال استصعب علي ممكن يكون سهل على غيري,,,,ويمكن والله ثلاثةايام وانا احاول فيه بس للأسف كل مره يطلع لي اخطاء.... :wallbash: :') وهل له اكثر من طريقه للحل

لذلك ارجو من ذوي الخبره مساعدتي فيه مشكورين...... :fff: :fff:

وهذا هو السؤال.....

write a java program to read a list of exam marks

(integer percentage in the range o to 100) and to output the total number of grade and

the number of grade in each letter-grade categories as shown below

Grade Exam marks

A 90-100

B 80-89

C 70-79

D 60-69

F 0-50

to end the output the user need to enter negative mark.Do not use the negatave score in the calculation

____________________________

out put

===========================

[ JUC GRADING SYSTEM ]

====program by:your name====

Enter the exam marks:

98

87

86

85

78

73

72

72

72

70

66

63

50

-1>>>end input

the total number of grade= 14

number of A's=1

number of B's=4

number of C's=6

number of D's=2

number of F's=1

the lowest score=50

the highest score=98

Average score=75.5

تم تعديل بواسطه loosh
رابط هذا التعليق
شارك

هذي احد المحاولات :wallbash:

import java.util.Scanner;

public class tt

{

public static void main(String[] args)

{

Scanner keyboard=new Scanner(System.in);

System.out.println("===========================");

System.out.println("[ JUC GRADING SYSTEM ]");

System.out.println("=====Program By:Sarah =====");

System.out.println(" Enter the exame marks: ");

int marks,total=0,min=0,max=0,A,B,C,D,F,sum;double av;

marks=keyboard.nextInt();

while((marks>=0)&&(marks<=100))

{ total++;

sum+=marks;

if(marks>=90)A++;

else if(marks>=80)B++;

else if(marks>=70)C++;

else if(marks>=60)D++;

else F++;

if (marks>max)

max=marks;

if(marks<min)

min=marks;

System.out.print(" " );

marks=keyboard.nextInt();

}

if(total>0)

av=sum/total;

System.out.println("the total number of grades="+total);

System.out.println("number of A's ="+A);

System.out.println("number of B's ="+B);

System.out.println("number of C's ="+C);

System.out.println("number of D's ="+D);

System.out.println("number of F's ="+F);

System.out.println("The maximum mark ="+max);

System.out.println("The minmum mark ="+min);

System.out.println("The average ="+av);

}

}

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information