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

[تنبيه - عنوان غير مناسب : ]جافا

بدأه Zaianb في 17 يناير 2010 · 2 رد · 503 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

مصرفك المحلي تعاقد لك تصميم تطبيق جافا العملية التي من شأنها توفير بيانات لحساب عميل معين في سنة نفترض

أن حساب التوفير accurse الفائدة بمعدل 12 في المئة سنويا. يجب على المستخدم إدخال رصيد الحساب ، والودائع الجارية ومبلغ من الانسحابات.

برنامجك الأساليب التي ينبغي أن يكون القيام بما يلي :

1. ( حساب الربح او الفائده) calcInterest

2. إيداع

3. سحب

الأسلوب الرئيسي ينبغي أن يطلب من المستخدم للحصول على المعلومات التالية

1. من فضلك أدخل اسمك

2. من فضلك أدخل رصيدك الحالي

3. من فضلك أدخل المبلغ الذي تريد إيداع

4. من فضلك أدخل المبلغ الذي تريد أن تنسحب

في نهاية الأسلوب الرئيسي ويجب عرض التقرير للمستخدم

معرف = nextId ؛

وأنا عملت البرنامج بس فيه أخطاء لو سمحت ممكن تصلحه لي

import staugIO.StaugIO;

public class FINAL_PROGECT1 {

 public static void main(String[] args) {

 StaugIO.io=new StaugIO();

 String fullname ="";

 fullname=io.readString ("Please Enter your name" );

 int account;
 account=io.readInt("Please Enter your current account" );

 int deposit;
 int totaldeposit=0;
 deposit=io.readInt("How much u want to deposit"+ "\nIn Exit Enter o");
 while (deposit>0)
 {

 	totaldeposit += deposit;
 	deposite=io.readInt("How much you want to deposit"+ "\nIn to Exit Enter o");

 }
 int withdraw;
 int totalwithdraw=o;

 withdraw=io.readInt("How much you want to withdraw"+ "/nIn to Exit Enter o");

 while(withdraw>0)

 	if (withdraw<= balanceMethod (account, totaldeposit, totalwithdraw))
 	{
 	withdraw=io.readInt("How much do you want to withdraw"+ "\nIn to E xit Enter o");
 	}
 	else
 	{

 		io.writeInfo("You can not withdraw" + withdraw);
 		break;

 	}	
 	io.writeInfo("user Name is " + name + "\nYour current Account" + account + "\n the amount you want to deposit to your account" + totaldeposit + "\nyou withdraw from your current account" + totalwithdraw + "\nyour account after adding deposit and taking withdraw" + balanceMethod(account,totaldeposit,totalwithdraw) +"\n finalaccount with intrest"(account,totaldeposit,totalwithdraw));


 }


 	public static int balanceMethod (int n1,int n2,int 3)
 	{
 		int calc;
 		calc=(n1+n2)-n3;
 		return calc;

 	}

 	{
 		double intrest;
 		intrest=balanceMethod(n1,n2,n3)*12;
 		return intrest;

 	}
 	{
 		double add;
 		add = balanceMethod(n1,n2,n3)+ intrestMethod (n1,n2,n3);
 		return add;

 	}
 )

تم تعديل هذه المشاركة بواسطة herch في 18 يناير 2010 في 00:11

#2

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته

مرحباً بكم في منتدى الفريق العربي للبرمجة

نود تنبيهك أن العنوان غير مناسب.

الرجاء اختيار عنوان مناسب أكثر في مواضيعك القادمة، وهذا بمثابة إشعار للأهمية.

وفي حال التكرار سيتعرض موضوعك للإغلاق والحذف!!!

قواعد المشاركة

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

#3

جزء كبير من الكود الذي كتبت غير مفهوم!!!

StaugIO.io=new StaugIO();

أزيلي النقطة وبدليها بفراغ. لا تكون هناك نقطة بين فئة الكائن وإسمه.

StaugIO io=new StaugIO();

في هذا السطر

io.writeInfo("user Name is " + name + "\nYour current Account" + account + "\n the amount you want to deposit to your account" + totaldeposit + "\nyou withdraw from your current account" + totalwithdraw + "\nyour account after adding deposit and taking withdraw" + balanceMethod(account,totaldeposit,totalwithdraw) +"\n finalaccount with intrest"(account,totaldeposit,totalwithdraw));

وخصوصا في هذا الجزء

"\n finalaccount with intrest"(account,totaldeposit,totalwithdraw));

غير واضح ما تريدين فعله. يبدو أنك تريدين المناداة على method، لكنك لم تعط إسمها.

أيضا هذا الكود غريب

 
 	{
 	double intrest;
 	intrest=balanceMethod(n1,n2,n3)*12;
 	return intrest;

 	}
 	{
 	double add;
 	add = balanceMethod(n1,n2,n3)+ intrestMethod (n1,n2,n3);
 	return add;

 	}

يبدو أنك تريدين كتابة methods، لكن بدون إسم!!!:blink:

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