-
Notifications
You must be signed in to change notification settings - Fork 1
/
ProductMain.java
25 lines (19 loc) · 929 Bytes
/
ProductMain.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package classstructureintegrate;
import java.util.Scanner;
public class ProductMain {
public static void main(String[] args) {
System.out.println("Termék neve?");
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
System.out.println("Termék ára?");
int price = scanner.nextInt();
Product product = new Product(name, price);
System.out.println("A(z) "+product.getName()+" ára "+product.getPrice()+" Ft.");
System.out.println("Mennyivel legyen drágább?");
product.increasePrice(scanner.nextInt());
System.out.println("A(z) "+product.getName()+" megnövelt ára "+product.getPrice()+" Ft.");
System.out.println("Mennyivel legyen olcsóbb?");
product.decreasePrice(scanner.nextInt());
System.out.println("A(z) "+product.getName()+" csökkentett ára "+product.getPrice()+" Ft.");
}
}