Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
חנות
בתרגיל הבא תכתבו חנות פשוטה, בה ניתן לקנות פיצה.
נתון לכם משתנה,
money
בו יש את כמות הכסף שיש ללקוח. אם יש לו יותר מ-20, הדפיסו למסך את ההודעה:
"You can buy pizza"
בואו נקנה פיצה
1
2
3
4
5
6
7
8
9
10
11
12
13
// {
package com.yourself;
public class Shop {
public static void shop(int money) {
// }
System.out.println("You have " + money + "$");
if(true){
}
// {
}
}
// }
Press desired key combination and then press ENTER.
זכרו: הפקודה להדפסה היא
System.out.println("message");
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content