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

خصم ضريبه ؟؟!

بدأه شادن..}~ في 26 نوفمبر 2010 · 12 رد · 799 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ,,,

يالليت احد يساعدني في ذا السؤال انا حليتو بس وقفت عند لما يقولي السعر اكبر من 500 ماعرفت اسوي خصم للضريبه

6. Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased. Compute a sales tax of:

• 8 percent if the users purchase is less than $100

• 7.5 percent if the purchase is greater or equal to $100.

• //Also if the purchase is over $500, give the customer an additional 10 percent after-tax discount.

• Print the purchase price, the amount of tax, the amount of the discount ($0.00 if no discount applies) and the total price.

• Output:

Enter number of items purchased= 60

the purchase price= 60 $

the amount of tax= 4.8

the total price= 64.8 $

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main ( )
{
int x,y;
printf("Enter Number of item purchased=");
printf("\n==============================\n");
scanf("%d",x);
printf("The prise = %d",x);
   if(x<100)
   {y=x*(8/100);
    printf("The amount tax=%d",x);
    printf("The total price=%d",x-y);}
   else if(x>100)
    {y=x*(7.5/100);
     printf("The amount tax=%d",x);
     print("The total price=%d",x-y);}
   else if(x>500)
getch();
 }

وكمان عندي سؤال في ذي المتسلسله مايطلع معي ناتج الجمع صح مدري ليش يالليت احد يساعدني فيها

دي متسلسله n....... 7/1 - 6 + 5/1 - 4+3\1 -2 +1

#include<stdio.h> 
#include<conio.h> 
#include<math.h> 
int main ( ) 
{ 
int x=1; int N,sum=0; 
printf("Enter The integer no.="); 
scanf("%d",&N) ; 
 while(x<=N) 
 {if(x%2==0) 
 {printf("%d-",x); 
 sum+=x;} 
 else 
 {printf("1/%d+",x); 
 sum+=-1.0/x;} 
 x++;} 

 printf("\bSUM=%d",sum); 
getch(); 
 }
#2

كمان عندي سؤال ثالث ,,, :blush:

اعتذر انو اسألتي كثيره ومبتدئه ,,,, :blush:

انا ابغى اسوي اله بأستخدام while ودي محاولتي وادري انه خطأ بس ذا اللي طلع معي ارجو تساعدوني كيف اسوي الاله ب while

يعني بعد مايخلص اسألو هل تبغى تدخل رقم ثاني واذا قالي ايوه اكمل واذا لا خلاس اوقف ...

#include<stdio.h>
#include<conio.h>
main()
{
      int x,y,z;
      char ans;
      printf("Enter the number And Opration\n");
      scanf("%d %c %d",&x,&ans,&y);
      switch(ans)
      {
                 case '+': printf("=%d",x+y); break;
                 case '-': printf("=%d",x-y); break;
                 case '*': printf("=%d",x*y); break;
                 case '/': if(y!=0) printf("=%f",(double)x/y);
                 else printf("cann't divide by zero \n"); break;
                 default : printf("Soory");
      }
      printf("\nDo you want enter again?");
      scanf("%s",&z);
      while(z==1)
      {printf("Enter the number And Opration\n");
      scanf("%d %c %d",&x,&ans,&y);
      switch(ans)
      {
                 case '+': printf("=%d",x+y); break;
                 case '-': printf("=%d",x-y); break;
                 case '*': printf("=%d",x*y); break;
                 case '/': if(y!=0) printf("=%f",(double)x/y);
                 else printf("cann't divide by zero \n"); break;
                 default : printf("Soory");
      }
      scanf("%d",x);}
      getch();
}
#3

السؤال الثالث :

#include<stdio.h>
#include<conio.h>
main()
{
      int x,y;
      char ans , z;
	  do
	  {
      printf("Enter the number And Opration\n");
      scanf("%d %c %d",&x,&ans,&y);
      switch(ans)
      {
                 case '+': printf("=%d",x+y); break;
                 case '-': printf("=%d",x-y); break;
                 case '*': printf("=%d",x*y); break;
                 case '/': if(y!=0) printf("=%f",(double)x/y);
                 else printf("cann't divide by zero \n"); break;
                 default : printf("Soory");
      }
      printf("\nDo you want enter again? Y / N ");
      scanf(" %c",&z);
	  }while(z=='Y'||z=='y');
      getch();
}

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#4

السلام عليكم

السؤال الأول : لا أعرف الإنجليزية, ترجمي إلى العربية أو الفرنسية.

السؤال الثاني :

#include<stdio.h>
#include<conio.h>
int main ( )
{
	 int x,N;
	 float sum = 1;
	 printf("Enter The integer = ");
	 scanf("%d",&N) ;
	 for(x = 2;x <= N;x++)
	 {
		  if(x%2==0) sum+=x;
		  else sum+=(float)-1/x;
	 }
	 printf("SUM = %f",sum);
	 getch();
	 return 0;
}

السؤال الثالث :

#include<stdio.h>
#include<conio.h>
main()
{
		int x,y,z;
		char ans,choice;
		debut :
		printf("Enter the number And Opration\n");
		scanf("%d %c %d",&x,&ans,&y);
		switch(ans)
		{
					  case '+': printf("=%d",x+y); break;
					  case '-': printf("=%d",x-y); break;
					  case '*': printf("=%d",x*y); break;
					  case '/': if(y!=0) printf("=%f",(float)x/y);
					  else printf("cann't divide by zero \n"); break;
					  default : printf("Soory");
		}
		printf("\nDo you want enter again ? (Y/N) : ");
		scanf("%s",&choice);
		if(choice == 'Y' || choice == 'y')
		goto debut;
		if(choice == 'N' || choice == 'n')
		return 0;
		if(choice != 'Y' && choice != 'y' && choice != 'N' && choice != 'n')
		printf("ERROR !\a");

		getch();
}

بالتوفيق :)

#5

كتابة برنامج طباعة السعر النهائي للشراء في متجر حيث كل شيء التكاليف بالضبط دولار واحد. أسأل عن عدد من البنود التي تم شراؤها. حساب ضريبة المبيعات من :

• 8 في المئة إذا كان شراء المستخدمين أقل من 100 $

• 7،5 في المئة إذا كان شراء أكبر أو تساوي 100 $.

• / / أيضا إذا كان شراء اكثر من 500 $ ، وإعطاء الزبون مبلغ إضافي 10 في المئة بعد خصم الضرائب.

• طباعة سعر الشراء ، ومقدار الضريبة ، ومقدار الخصم (0،00 $ وإذا لم ينطبق الخصم) والسعر الإجمالي.

• إخراج :

اشتريت أدخل عدد العناصر = 60

سعر الشراء = 60 $

مبلغ الضريبة = 4،8

السعر الاجمالي = 64.8 $

دي ترجمه السؤال ,,,,,

شكرا اشراقة فجر بس انا ابغاها ب while مو do while

واخ خالد انا ماابغى ب for ابغى ب while

وشكرا للجميع

#6

بليز تكفون احد يساعدني على الاقل في السؤال الاول مره ضروري :blush:

#7
while(z=='Y'||z=='y');

اختي هينا ليه استخدمي || او :wacko: انا جربت احلها بدون او بس مايخليني اكمل ليه ايش السبب

#8
اقتباس
واخ خالد انا ماابغى ب for ابغى ب while

لو راجعت دروس الحلقات جيدا لعرفتِ طريقة التحويل بين while و do while و for ! :)

هذا الكود بالـ while :

#include<stdio.h>
#include<conio.h>
int main ( )
{
         int x = 2,N;
         float sum = 1;
         printf("Enter The integer = ");
         scanf("%d",&N) ;
        while(x++ <= N)
         {
                  if(x%2==0) sum+=x;
                  else sum+=(float)-1/x;
         }
         printf("SUM = %f",sum);
         getch();
         return 0;
}

بالتوفيق.

#9

شكرا اخ خالد بس انا مبتدئه ودوبني اخذت while for do while لكن مااعرف طريقه التحويل بينهم

وبالنسبه لسؤال الاول الحمدلله حليته امس بعد عناء :wacko:

#10

بـ While ,

#include<stdio.h>
#include<conio.h>
int main()
{
      int x,y;
      char ans , z='y';
      while(z=='Y'||z=='y')
      {
      printf("Enter the number And Opration\n");
      scanf("%d %c %d",&x,&ans,&y);
      switch(ans)
      {
                 case '+': printf("=%d",x+y); break;
                 case '-': printf("=%d",x-y); break;
                 case '*': printf("=%d",x*y); break;
                 case '/': if(y!=0) printf("=%f",(double)x/y);
                 else printf("cann't divide by zero \n"); break;
                 default : printf("Soory");
      }
      printf("\nDo you want enter again? Y / N ");
      scanf(" %c",&z);
      }
      getch();
}

اقتباس
اختي هينا ليه استخدمي || او :wacko: انا جربت احلها بدون او بس مايخليني اكمل ليه ايش السبب

استخدم الـ Or , لأن يمكن المستخدم يدخل y او Y ..

بالتوفيق :happy: ,

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#11

:blush: شكرا ويعطيكم الف عافيه جميعا

#12

-4 إرجاع !!؟

ما کان جواب أخت إشراقة فجر و أخی خالد صحیح؟

#13

التمرين الاول

تفضل الحل

#include<stdio.h> 
#include<conio.h> 
int main () 
{ 
  int x,y,total,add; 
  printf("Enter Number of item purchased"); 
  printf("\n==============================\n"); 
  scanf("%d",&x); 
  printf("the purchase price = %d $\n",x);
   if(x>=500) 
   {
    y=x*(7.5/100); 
    total=x+y;
    add=total+total*0.1;
    printf("The amount tax = %d\n",y);
    printf("The total price = %d $\n",total);
    printf("give the customer an additional 10 percent after-tax discount : %d $",add);        
   }
   else if(x>=100) 
   {
    y=x*(7.5/100); 
    total=x+y;
    printf("The amount tax = %d\n",y);
    printf("The total price = %d $\n",total);
   } 
   else if(x<100) 
   {
    y=x*0.08;
    total=x+y;
    printf("The amount tax = %d\n",y);
    printf("The total price = %d $\n",total);
   } 

getch(); 

}

مع العلم انه يجب ان تعرف نسبة الضريبة في حالة اكثر من 500 دولار و تقوم بتغيرها في التمرين المدرج اعله

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