ABA


"צריך בבקשה עזרה בתוכנית בפסקל"
גירסת הדפסה        
קבוצות דיון פיתוח, תיכנות ובניית אתרים נושא #7046 מנהל    סגן המנהל    מפקח   Winner    צל"ש   מומחה  
אשכול מספר 7046
BasketBoy
חבר מתאריך 1.8.02
330 הודעות
   12:59   27.09.03   
אל הפורום  
  צריך בבקשה עזרה בתוכנית בפסקל  
 
אני צריך לבנות תוכנית לחישוב הסכום לתשלום בחנות מחשבים, התוכנית תדפיס מהו הסכום לתשלום, בנוסף תקלוט את התשלום ותחזיר עודף במספר מטבעות מינימלי.
סיימתי להכין את זה וזה אומר לי שיש בעיה ואני לא קולט מה הבעיה...
הנה מה שהכנתי
program comp_shop;
var
sum,price,odef:real;
money:integer;

begin
sum:=0; price:=0; odef:=0;
writeln('press price, for exit press -999');
readln(price);
while price<>-999 do
begin
sum:=sum+price;
writeln('press price');
readln(price);
end ;
writeln('the sum letashlom = ',sum);
writeln('press the money that get');
writeln(money);
odef:=money-sum;
writeln('the odef from the money is = ',odef,' shekels');
writeln('the odef in the less possible matbeot is = ');
if (odef div 200>0)
then writeln (odef div 200, ' shtarot shel 200 shekels');
if (odef div 100>0) and (odef div 100<2)
then writeln(' shtar shel 100 shekels');
if (odef div 50>0) and (odef div 50<2)
then writeln(' shtar shel 50 shekels');
if (odef div 20>0) and (odef div 20<3)
then writeln(odef div 20, ' shtarot shel 20 shekels');
if (odef div 10>0) and (odef div 10<2)
then writeln('matbea 1 shel 10 shekels');
if (odef div 5<0) and (odef div 5<2)
then writeln('matbea 1 shel 5 shekels');
if (odef div 1>0 and (odef div 1<5)
then writeln(odef div 1,'matbeot shel 1 shekels');
readln;
end .

תודה מראש !

בברכה,
אלון.


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

  האשכול     מחבר     תאריך כתיבה     מספר  
  סתם שאלה.. SpyCop 27.09.03 16:02 1
     ... BasketBoy 27.09.03 23:08 2
  סידרתי כמה דברים אבל עדיין זה עושה בעיות... BasketBoy 27.09.03 23:10 3
     אם אתה רוצה שבאמת יעזרו לך SpyCop 28.09.03 10:28 4
     קודם כל ככה זה נראה הרבה יותר טוב szargel 28.09.03 13:00 5
  לא משנה כבר תודה BasketBoy 28.09.03 14:03 6

       
SpyCop

   16:02   27.09.03   
אל הפורום  
  1. סתם שאלה..  
בתגובה להודעה מספר 0
 
   איך אתה יודע מה הסכום ?


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
BasketBoy
חבר מתאריך 1.8.02
330 הודעות
   23:08   27.09.03   
אל הפורום  
  2. ...  
בתגובה להודעה מספר 1
 
sum:=sum+price;

בברכה,
אלון.


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
BasketBoy
חבר מתאריך 1.8.02
330 הודעות
   23:10   27.09.03   
אל הפורום  
  3. סידרתי כמה דברים אבל עדיין זה עושה בעיות...  
בתגובה להודעה מספר 0
 
בבקשה תעזרו לי
program comp_shop;
var
sum,price,odef:real;
money:integer;

begin
sum:=0; price:=0; odef:=0;
writeln('press price, for exit press -999');
readln(price);
while price<>-999 do
begin
sum:=sum+price;
writeln('press price');
readln(price);
end ;
writeln('the sum letashlom = ',sum);
writeln('press the money that get');
writeln(money);
odef:=money-sum;
writeln('the odef from the money is = ',odef,' shekels');
writeln('the odef in the less possible matbeot is = ');
if odef>=200 then
begin
writeln(odef div 200,' shtarot shel 200 ');
odef:=odef mod 200;
end ;
if odef>=100 then
begin
writeln(odef div 100,'shtarot shel 100 nis');
odef:=odef mod 100;
end ;
if odef>=50 then
begin
writeln(odef div 50,'shtarot shel 50 nis');
odef:=odef mod 50;
end ;
if odef>=20 then
begin
writeln(odef div 20,'shtarot shel 20 nis');
odef:=odef mod 20;
end ;
if odef>=10 then
begin
writeln(odef div 10,'matbeot shel 10 nis');
odef:=odef mod 10;
end ;
if odef>=5 then
begin
writeln(odef div 5,'matbeot shel 5 nis');
odef:=odef mod 5;
end ;
if odef>=1 then writeln(odef div 1,'matbeot shel 1 nis');
readln;
end .

בברכה,
אלון.


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
SpyCop

   10:28   28.09.03   
אל הפורום  
  4. אם אתה רוצה שבאמת יעזרו לך  
בתגובה להודעה מספר 3
 
   תשים את הקודים בטאג קוד
{CODE}
קוד
{/CODE}

במקום סוגריים מסולסלים, סוגריים מרובעים.


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
szargel

   13:00   28.09.03   
אל הפורום  
  5. קודם כל ככה זה נראה הרבה יותר טוב  
בתגובה להודעה מספר 3
 
  

>program comp_shop;
>var
> sum,price,odef:real;
> money:integer;
>
>begin
> sum:=0; price:=0; odef:=0;
> writeln('press price, for exit press -999');
> readln(price);
> while price<>-999 do
> begin
> sum:=sum price;
> writeln('press price');
> readln(price);
> end ;
> writeln('the sum letashlom = ',sum);
> writeln('press the money that get');
> writeln(money);
> odef:=money-sum;
> writeln('the odef from the money is = ',odef,'
>shekels');
> writeln('the odef in the less possible matbeot is = ');
> if odef>=200 then
> begin
> writeln(odef div 200,' shtarot shel 200 ');
> odef:=odef mod 200;
> end ;
> if odef>=100 then
> begin
> writeln(odef div 100,'shtarot shel 100 nis');
> odef:=odef mod 100;
> end ;
> if odef>=50 then
> begin
> writeln(odef div 50,'shtarot shel 50 nis');
> odef:=odef mod 50;
> end ;
> if odef>=20 then
> begin
> writeln(odef div 20,'shtarot shel 20 nis');
> odef:=odef mod 20;
> end ;
> if odef>=10 then
> begin
> writeln(odef div 10,'matbeot shel 10 nis');
> odef:=odef mod 10;
> end ;
> if odef>=5 then
> begin
> writeln(odef div 5,'matbeot shel 5 nis');
> odef:=odef mod 5;
> end ;
> if odef>=1 then writeln(odef div 1,'matbeot shel 1
>nis');
> readln;
>end .

עכשיו אם גם תגיד לנו איזה הודעת שגיאה אתה מקבל, ובאיזה שורה היא זה יהיה אפשרי לפתור לך אותה


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
BasketBoy
חבר מתאריך 1.8.02
330 הודעות
   14:03   28.09.03   
אל הפורום  
  6. לא משנה כבר תודה  
בתגובה להודעה מספר 0
 
הצלחתי, פשוט הייתי צריך לעשות את המשתנים כולם integer

בברכה,
אלון.


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

תגובה מהירה  למכתב מספר: 
 
___________________________________________________________________

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



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