عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 31-03-2011, 05:52 PM

looly77 looly77 غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Mar 2011
التخصص: cs
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 9
Skaau.com (11) ياجماعه بليز شرح للسوالين >جافا


ياجماعه بليز شرت للسوالين مساعده بسيطه تكفوووون في لغه الجافا
كود:
Method name: countOccurrenceOfMultiplesOf5
Parameters: int num1, int num2
Return: int
Logic: Method should count how many number between num1 and num2, included, are multiples of 5.

Method Name: filter
Parameters:int num
Return:String
Logic: Using Switch statement,if num is 1, 2, 3 returns “school day”, if 4, or 7
returns “Off Day”. Otherwise, returns “Nightmare”
Fix the logical Errors
//The method below should compare two strings,
//returns “same” if two Strings are identical.
//If they differ, determines the position of
//the first letter at which the two strings differs,
//and returns that position
public String compareStrings(String a,String b){
int pos =0;
if (a.equals(b)){
return "same";
}else{
while (b.charAt(pos)!=a.charAt(pos));
{
pos++;
}
return "They differ at position:" + pos;
}}
رد مع اقتباس