Advertiser a5new Advertiser Advertiser a6new Advertiser

Advertiser a5new advertiser advertiser a6new

This preview shows page 20 - 24 out of 46 pages.

Advertiser a5=new Advertiser(); Advertiser a6=new Advertiser(); a1.createAdvertiser(1,"Nolan","1Nolan","male",21,1000,"I want someone","female",25,30,2000,3000); a2.createAdvertiser(2, "Ray", "2Ray", "male", 18, 1000, "I want pretty girl", "female", 18, 20, 1000, 2000); a3.createAdvertiser(3,"Alden","3Alden","male",31,5000,"I want to date","female",20,25,2000,3000); a4.createAdvertiser(4, "Evan", "4Evan", "male", 25, 2000, "I want a girl", "female", 20, 25, 1000, 5000); a5.createAdvertiser(5,"Zoey","5Zoey","female",20,1500,"I need someone","male",25,30,1000,5000); a6.createAdvertiser(6, "Jessie", "6Jessie", "female1", 28, 3000, "Hi boys", "male", 20, 30, 4000, 8000); advList.add(a1); advList.add(a2); advList.add(a3); advList.add(a4); advList.add(a5); advList.add(a6); Responder r1=new Responder();
Image of page 20
Responder r2=new Responder(); Responder r3=new Responder(); Responder r4=new Responder(); Responder r5=new Responder(); Responder r6=new Responder(); r1.createResponder(7, "Alvin", "7Alvin", "male", 19, 4000, "[email protected]", 927384726); r2.createResponder(8, "Mavric", "8Mavric", "male", 27, 5000, "[email protected]", 97361524); r3.createResponder(9, "Alex", "9Alex", "male", 20, 4000, "[email protected]", 93625146); r4.createResponder(10, "Rosy", "10Rosy", "female", 19, 1500, "[email protected]", 98376289); r5.createResponder(11, "Mary", "11Mary", "female", 28, 2000, "[email protected]", 93726273); r6.createResponder(12, "Dara", "12Dara", "female", 21, 2500, "[email protected]", 95837273); respList.add(r1); respList.add(r2); respList.add(r3); respList.add(r4); respList.add(r5); respList.add(r6); int cId=advList.size()+respList.size(); while(in!=8) { showMenu(); in=input.nextInt(); if(in==1) { System.out.println("-----Advertiser Log in-----"); Scanner advLogin=new Scanner(System.in); String advName,advPwd; System.out.println("Enter user name"); advName=advLogin.nextLine(); System.out.println("Enter password"); advPwd=advLogin.nextLine(); boolean advFound=false; for(int i=0;i<advList.size();i++)
Image of page 21
{ if(advName.equals(advList.get(i).getCustName()) && advPwd.equals(advList.get(i).getCustPwd())) { System.out.println("Welcome"+advName); System.out.println("*****Your list of reply messages*****"); advList.get(i).printMessage(); System.out.println("Please enter the message ID that you want to delete or press 0 to exit to main menu"); Scanner advMenu=new Scanner(System.in); int delMesg=advMenu.nextInt(); if(delMesg==0) { System.out.println("Logging out"); } else { boolean deleted=advList.get(i).deleteMessage(delMesg); if(deleted==true) { System.out.println("Message has been deleted"); } else { System.out.println("Message ID not found"); } } advFound=true; } } if(advFound==false) { System.out.println("Pleas enter correct user name and password"); } } else if(in==2)
Image of page 22
{ System.out.println("-----Responder Log in-----"); Scanner respLogin=new Scanner(System.in); String respName,respPwd; System.out.println("Enter user name"); respName=respLogin.nextLine(); System.out.println("Enter password"); respPwd=respLogin.nextLine(); boolean respFound=false; boolean matchFound=false; for(int i=0;i<respList.size();i++) { if(respName.equals(respList.get(i).getCustName()) && respPwd.equals(respList.get(i).getCustPwd())) { int rAge=respList.get(i).getCustAge(); int rIncome=respList.get(i).getCustIncome(); String rGender=respList.get(i).getCustGender(); System.out.println("Welcome"+respName); for(int j=0;j<advList.size();j++) { int aMinAge=advList.get(j).getPD().getMinAge(); int aMaxAge=advList.get(j).getPD().getMaxAge(); int aMinIncome=advList.get(j).getPD().getMinIncome(); int aMaxIncome=advList.get(j).getPD().getMaxIncome(); String aGender=advList.get(j).getPD().getpGender(); if(rAge>=aMinAge && rAge<=aMaxAge && rIncome>=aMinIncome && rIncome<=aMaxIncome && rGender.equals(aGender)) { System.out.println("Your match ID-"+advList.get(j).getCustId()+"
Image of page 23
Image of page 24

You've reached the end of your free preview.

Want to read all 46 pages?

  • One '14
  • Login, advertiser

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture