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

I want a help in writing the code

مغلق
بدأه eng_ibr في 19 نوفمبر 2004 · 7 رد · 778 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

I want to ask about these questions , who can write the code , i tried on it but it seems no hope to complete it , the question is not difficult , and i will appreciate for you

//question 1

8.16 Create class SavingsAccount. Use a static class variable to store the annualInterestRate
for all account holders. Each object of the class contains a private instance variable
savingsBalance indicating the amount the saver currently has on deposit. Provide method
calculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance
by annualInterestRate divided by 12; this interest should be added to savingsBalance.
Provide a static method modifyInterestRate that sets the
annualInterestRate to a new value. Write a driver program to test class SavingsAccount.
Instantiate two savingsAccount objects, saver1 and saver2, with balances of $2000.00 and
$3000.00, respectively. Set annualInterestRate to 4%, then calculate the monthly interest and
print the new balances for each of the savers. Then set the annualInterestRate to 5% and calculate
the next month’s interest and print the new balances for each of the savers.

//question 2

8.17 Create class IntegerSet. Each object of the class can hold integers in the range 0 through
100. A set is represented internally as an array of booleans. Array element a is true if integer
i is in the set. Array element a[j] is false if integer j is not in the set. The no-argument constructor
initializes a set to the so-called “empty set” (i.e., a set whose array representation contains all false
values).
Provide the following methods: Method unionOfIntegerSets creates a third set which is
the set-theoretic union of two existing sets (i.e., an element of the third set’s array is set to true if
that element is true in either or both of the existing sets; otherwise, the element of the third set is
set to false). Method intersectionOfIntegerSets creates a third set which is the set-theoretic
intersection of two existing sets i.e., an element of the third set’s array is set to false if that
element is false in either or both of the existing sets; otherwise, the element of the third set is set
to true). Method insertElement inserts a new integer k into a set (by setting a[k] to true).
Method deleteElement deletes integer m (by setting a[m] to false). Method setPrint
prints a set as a list of numbers separated by spaces. Print only those elements that are present in the
set. Print --- for an empty set. Method isEqualTo determines if two sets are equal. Write a program
to test your IntegerSet class. Instantiate several IntegerSet objects. Test that all your                     
methods work properly.

And i will be thanked

تم تعديل هذه المشاركة بواسطة مجدي محمود في 19 نوفمبر 2004 في 13:55

اللهم صل وسلم وزد وبارك على سيدنا محمد وعلى آله وصحبه وسلم

تعلم كيف تقرأ من ملف باستخدام لغة السي

Routers Programming-الدرس الأول

#2

اين محاولتك اقصد ما قمت بعمله بنفسك

لست متواجد بشكل يومي

#3

قبل هذا ... اجد ان الموضوع مخالف في عنوانه .. مارايك اخ مجدي

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why

#4

Hello, but execuse me this my try for question 1

The main class is not that difficult so i didnt put it here

class SavingAccount
{
SavingAccount(SavingBallance)
static double annualrate,
private SavingBallance,
double Calculate MonthlyInterest()
{
double x;
x=SavingBalance*AnnualInterestRate/12
retrun x;
}
}

For Q2

I didnt understand how i can Call the array to be boolean and contain double numbers

تم تعديل هذه المشاركة بواسطة مجدي محمود في 19 نوفمبر 2004 في 21:24

اللهم صل وسلم وزد وبارك على سيدنا محمد وعلى آله وصحبه وسلم

تعلم كيف تقرأ من ملف باستخدام لغة السي

Routers Programming-الدرس الأول

#5

eng_ibr

يبدو انك لم تنتبه لكلامي....هل هذا مقصود منك ولا ماذا..

ارجو توضيح موقفك

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why

#6
Hello there, But i wonder what do you mean by represent your situation
Number two: If i was wrong tell me where is it
Number three: You are a supervisor and i am a participant and each of us can learn from each other
Third: This arabteam2000 for arab and we all arab here as i think so no need to fight each other cause i consider each one here is like my brother
Fourth: you just can sayed Where is the problem in my writing and all would be over

Good Bye and i hope to take my speak as discussion not fightng or ......anything else

اللهم صل وسلم وزد وبارك على سيدنا محمد وعلى آله وصحبه وسلم

تعلم كيف تقرأ من ملف باستخدام لغة السي

Routers Programming-الدرس الأول

#7

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

و على كل حصل خير و ارجو منك قراءة قواعد المشاركة و التقيد بها

و اهلا بك اخ عزيز معنا

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why

#8
Hello and thanks for clearing the subject, 
 i didnt insist in this object , any way i read the regulations very well.
and as i sayed here we all brother because you are from Iraq and iam From Palestine. 
Good Bye

اللهم صل وسلم وزد وبارك على سيدنا محمد وعلى آله وصحبه وسلم

تعلم كيف تقرأ من ملف باستخدام لغة السي

Routers Programming-الدرس الأول

هذا الموضوع مغلق.

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