Type mismatch
מישהו יכול להגיד לי מה זאת השגיאה הזאת ואיך אפשר לפתור אותה? הנה הקוד: ==================================================================== program Targil6; var I, ProductCode,ProductPrice,NewPrice, X,Z: integer; begin for I := 1 to 10 do begin Writeln ('Enter product code:'); Readln (ProductCode); Writeln ('Enter Product Price:'); Readln (ProductPrice); X:= ProductCode / 7; {פה הוא עושה לי את השגיאה, הוא מצביע על ה-7.) if X mod 2 = 0 then begin Z:= (15 * ProductPrice)/ 100; NewPrice:= ProductPrice + Z; Writeln ('Product code is:', ProductCode); Writeln ('Product Price is:', ProductPrice); end; else if X mod 2 <> 0 then begin Z:= (10 * ProductPrice)/ 100; NewPrice:= ProductPrice - Z; Writeln ('Product code is:', ProductCode); Writeln ('Product Price is:', ProductPrice); end; end. ==================================================================== השגיאה היה בחילוק ב-7 , מישהו יכול להגיד לי איך אני פותר את זה? מצטער על הצפת השאלות בפסקל אבל זה פורום וכאן המקום לשאול, (לא..?)
מישהו יכול להגיד לי מה זאת השגיאה הזאת ואיך אפשר לפתור אותה? הנה הקוד: ==================================================================== program Targil6; var I, ProductCode,ProductPrice,NewPrice, X,Z: integer; begin for I := 1 to 10 do begin Writeln ('Enter product code:'); Readln (ProductCode); Writeln ('Enter Product Price:'); Readln (ProductPrice); X:= ProductCode / 7; {פה הוא עושה לי את השגיאה, הוא מצביע על ה-7.) if X mod 2 = 0 then begin Z:= (15 * ProductPrice)/ 100; NewPrice:= ProductPrice + Z; Writeln ('Product code is:', ProductCode); Writeln ('Product Price is:', ProductPrice); end; else if X mod 2 <> 0 then begin Z:= (10 * ProductPrice)/ 100; NewPrice:= ProductPrice - Z; Writeln ('Product code is:', ProductCode); Writeln ('Product Price is:', ProductPrice); end; end. ==================================================================== השגיאה היה בחילוק ב-7 , מישהו יכול להגיד לי איך אני פותר את זה? מצטער על הצפת השאלות בפסקל אבל זה פורום וכאן המקום לשאול, (לא..?)