Advertisement
Guest User

Woop

a guest
Sep 16th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. package com.benjaminbengtsson.grupparbetemindel;
  2.  
  3. import java.io.Console;
  4. import static java.lang.System.out;
  5. import javax.swing.JOptionPane;
  6.  
  7. /**
  8.  *
  9.  * @author Benjamin
  10.  */
  11. public class DatingSite {
  12.     public static void main(String[] args) {
  13.         Console c = System.console();
  14.        
  15.         if (c == null){
  16.         JOptionPane.showMessageDialog(null, "You need a console");
  17.     }
  18.        
  19.         String name = c.readLine("What is your name?: "),
  20.                 gender = c.readLine("What is your gender? (Man/Woman): ");
  21.         int age = Integer.parseInt(c.readLine("How old are you?: "));
  22.        
  23.        
  24.         Profile dater = new Profile();
  25.         dater.setProfile(name, gender, age);
  26.         out.println("Your name is " + dater.getProfileName() + ", you are a " + dater.getProfileGender() + " and you are " + dater.getProfileAge() + " years old.");
  27.    
  28.     if(dater.getProfileAge() < 50 && "man".equals(dater.getProfileGender())) {
  29.         out.println("Welcome to Pervert Finder!");
  30.     }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement