ABA


"עזרה בשאלה קטנה בJAVA מדעי המחשב שנה א'"
גירסת הדפסה        
קבוצות דיון פיתוח, תיכנות ובניית אתרים נושא #10133 מנהל    סגן המנהל    מפקח   Winner    צל"ש   מומחה  
אשכול מספר 10133
GaMBa  לחץ כאן להצגת דירוג המשתמש
חבר מתאריך 1.9.02
5075 הודעות, 6 פידבק
   18:42   04.11.10   
אל הפורום  
  עזרה בשאלה קטנה בJAVA מדעי המחשב שנה א'  
 

Question 7 Consider the following functions for reversing a number's digits in base-10, and calculating the result in given base (simultaneously).

For example, convertRadix(23, 16) will return 50, since 23 reversed is 32, but represents 50 in base-16 (tex). Written in common notation, tex.

Complete the conversionStep function to achive this goa
.
public static int conversionStep(int state, int radix) {
int result = { /* 1 */, state /* 2 */ + state /* 3 */ };
return result;
}

public static int convertRadix(int n, int radix) {
int state = { n, 0 };
while (state != 0)
state = conversionStep(state, radix);

return /* 4 */;
}

אני אמור לכתוב מה צריך לשים בארבעת ההערות... :\


                                שתף        
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

תגובה מהירה
___________________________________________________________________

___________________________________________________________________
למנהלים:  נעל | תייק בארכיון | מחק | העבר לפורום אחר | מחק תגובות | עגן אשכול
       



© כל הזכויות שמורות ל-רוטר.נט בע"מ rotter.net