Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Targil2 {
- public static void main(String[] args) {
- Scanner s= new Scanner (System.in);
- final int family=1000;
- final int friends=500;
- final int elsefriends=250;
- int yeers=3;
- int know;
- int totalfriends=0;
- int totalelsefriends = 0;
- int drive;
- System.out.println("how much time you know the family?");
- know=s.nextInt();
- if (know>=yeers) {
- totalfriends = friends + 50;
- totalelsefriends = elsefriends + 50;
- }
- else {
- totalelsefriends=250;
- totalfriends=500;
- }
- System.out.println("how much time drive to wedding?");
- drive=s.nextInt();
- if (drive>=1){
- totalelsefriends=friends-50;
- totalelsefriends=elsefriends-50;
- }
- else {
- totalelsefriends=totalelsefriends;
- totalfriends=totalfriends;
- }
- System.out.println("you need to put if your are friends"+""+totalfriends+"if you are else friend"+totalelsefriends+"if you are family"+family);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement