Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

noN DATE. Coding Exercises: For all problems follow proper coding guidelines wit

ID: 3807202 • Letter: N

Question

noN DATE. Coding Exercises: For all problems follow proper coding guidelines with regard to punctuaton, spacing, syntax, etc . Assume all methods coded are in the same program as a main" Use annta (with specifiers if needed) for prompts and output. Assume input for the Scanner class is already declared. Do not write in all caps except where permitted according to Java rules. For each question, read the entire instruction first then follow step-by-step. 31. Code a value-receiving method called costumes() that receives a number for a party event. Inside this method is a switch statement that tests partyEvent so when partyEvent is 1 the value- returning method valentines is called; when 2 the value-returning method mardiGras is called, When 3 the value-returning method halloween is called, and when it is not any of the above we message "The party you want is not planned!" is displayed. The methods valentines mardGras, and halloween return the number of attendees for each respective party event whic added to a global variable called totalAttendees that is already declared. (10 points)

Explanation / Answer

private static int costumes(int partyEvent){
       int numberofAttendees=0;
       switch(partyEvent){
           case 1:
               numberofAttendees = valentines();
               System.out.println("Number of attendees are: "+numberofAttendees);
               break;
           case 2:
               numberofAttendees = mardiGras();
               System.out.println("Number of attendees are: "+numberofAttendees);
               break;
           case 3:
               numberofAttendees = halloween();
               System.out.println("Number of attendees are: "+numberofAttendees);
               break;
           default:
               System.out.println("The party you want is not planned");
       }
       return numberofAttendees;
   }

   private static int halloween(){
       return NUMBER_OF_ATTENDEES;
   }
  
   private static int mardiGras(){
       return NUMBER_OF_ATTENDEES;
   }
  
   private static int valentines(){
       return NUMBER_OF_ATTENDEES;
   }
  
   private static int avgAttendees(){
       int sum =0;
      
       for(int i=1;i<4;i++){
           sum = sum+ costumes(i);
       }
       return (sum/3);
   }
  
   private static boolean games(int bannerid, int asapbannerId){
       boolean setAdmitFree = false;
       if(bannerid == asapbannerId){
           setAdmitFree = true;
       }
      
       return setAdmitFree;
   }
  
   private static void games(int bannerid, int asapbannerId,boolean fullTime){
       if(games(bannerid, asapbannerId) && fullTime){
           System.out.println("Ticket printing for your free admittance to the game! Go RoadRunners!");
       }
       else{
           System.out.println("Sorry! you need to purchase a ticket to the game.");
       }
          
   }