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

برنامج حساب نسبة رجل المبيعات

مغلق
بدأه sweetanjle في 9 مارس 2006 · 8 رد · 765 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

[COLOR=purple]السلام عليكم ورحمة الله وبركاته ..

انا ارجوووكم تسااعدوني في حل هالسؤااال :^)

انا مبتداءه في الجافا :D وصراحه مره متوهقه :s

بلييز بليييز ساعدوني :wacko:

لا تبخلون علي بلييز :

A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for the week. For example, a salesperson who sells $5,000 worth of merchandise in a week receives $200 plus 9% of $5,000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows:

Item Value

1 239.99

2 129.75

3 99.95

4 350.89

Develop a Java application that inputs one salesperson's items sold for last week and calculates and displays the salesperson's earnings. There is no limit to the number of items that can be sold by a salesperson.

بليزز ساعدوني باسرع وقت

#2

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

انا حاولت فيه يا sweetanjle بس ماوصلت للحل :(

واذا في احد يعرف يبرمج انه يساعدك علشان تعم الفائده للجميع :)

تحياتي لك :)

#3

مشكووووره يا اسيرة الصمت :)

على الدعمك

#4

السلام عليكم ،،،

هل الأسعار تكون معروفة مسبقاً لكل صنف من قبل البرنامج فيصبح كل ماعلينا إدخاله فقط رقم الصنف المباع من قبل الـ Sales Person أو أنه يتم إدخال أسعار الأصناف المباعة من قبل المستخدم في كل مرة يتم فيها حساب مستحقات الـ Sales Person .

إعمتاداً للفرضية الثانية أتمنى أن يكون هذا هو الـ Code المناسب : :)

import java.io.*;

public class SalesPerson {


static void calculate (double totalItems){

System.out.println("The SalesPerson's Earnings per week should be: "+ (0.09*totalItems+200) +"$."); 

}


public static void main(String[] args) throws IOException{

BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));

int count=1;

double sum=0;

while(true){

System.out.println("Enter the price of Item "+count+" sold by the Sales Person or 0 to stop: ");

if(Integer.parseInt(stdin.readLine())==0)

break;

sum+=Double.parseDouble(stdin.readLine());

count++; }

calculate(sum); } }

*-)

public Money getRich(String name){
return new Money(1,000,000,000 );
}
#5

مشكور أخوي red_knight على تجاوبك..

أعتقد أن السؤال مفترض سلع معينة بأسعار محددة..(الفرضية الأولى)..

شكراً..

#6

لربما في هذا انعاش للذاكرة: /index.php?showtopic=29343

وعذرا على التدخل!

« Everything looks different from another cracker point of view »

« There are 11 types of people, those who understand binary, those who don't, well I'm the rest »

« ?Do you speak Binary »

me W4R3ZD00D/

#7

العفو ...

إذن هذا هو الـ code المناسب :

import java.io.*;

public class SalesPerson {


static void calculate (double totalItems){

System.out.println("The SalesPerson's Earnings per week should be: "+ (0.09*totalItems+200) +"$."); 


}

public static void main(String[] args) throws IOException{

BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));

double[] items={239.99,129.75,99.95,350.89};

int count=1;

double sum=0;

while(true){

System.out.println("Enter the value of Item "+count+" sold by the Sales Person or 0 to stop: ");

if(Integer.parseInt(stdin.readLine())==0)

break;

sum+=items[Double.parseDouble(stdin.readLine())-1];

count++; }

calculate(sum); } }
public Money getRich(String name){
return new Money(1,000,000,000 );
}
#8

مشكووور اخوي red_knight وما تقصر :rolleyes:

والله يعطيك العافيه على المجهود الي بذلته معاي

والي بيستفيد منه الجميع إن شاء الله ;)

#9

السلام عليكم ،،،

العضو : Sweet Angle

هناك خطأين في البرنامج والتعديل كالتالي :

import java.io.*;

public class SalesPerson {


static void calculate (double totalItems){

System.out.println("The SalesPerson's Earnings per week should be: "+ (0.09*totalItems+200) +"$."); 


}

public static void main(String[] args) throws IOException{

BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));

double[] items={239.99,129.75,99.95,350.89};

int count=1;

double sum=0;

while(true){

System.out.println("Enter the value of Item "+count+" sold by the Sales Person or 0 to stop: ");

String input=stdin.readLine();
if(Integer.parseInt(input)==0)

break;

sum+=items[Integer.parseInt(input)-1];

count++; }

calculate(sum); } }
public Money getRich(String name){
return new Money(1,000,000,000 );
}

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

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

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…