Else profitbinsteda 0 return profitbinsteda end of

This preview shows page 4 - 6 out of 6 pages.

else { profitBinstedA = 0; return profitBinstedA; } }//end of method save when buy B insted of A //This method will display the profit when they buy C not A public static void displayBA(double profitBandA) { if (profitBandA > 0) System.out.printf("You will save $ %.2f if you buy package B\n",profitBandA); else System.out.println(""); } //This method will count how much money save when buy C insted of A public static double profitCinstedA(double priceA, double priceC,double hour,double extraA) { double profitCinstedA; if(hour > 15) { if (hour > 16) { profitCinstedA = (priceA + ((hour - 10)* extraA)) - priceC; return profitCinstedA; } else { profitCinstedA = 0; return profitCinstedA; } } else { profitCinstedA = 0; return profitCinstedA; } }//end of method save when buy C insted A //This method will display the profit when they buy C not A public static void displayCA(double profitCandA) { if (profitCandA > 0) System.out.printf("You will save $%,.2f if you buy package C\n",profitCandA); else System.out.println(""); }
Image of page 4

Subscribe to view the full document.

//This method will count how much money save when buy C insted of B public static double profitCinstedB(double priceB, double priceC,double hour,double extraB) { double profitCinstedB; if(hour > 26) { if (hour > 27) { profitCinstedB = (priceB + ((hour - 20)* extraB)) - priceC; return profitCinstedB; } else { profitCinstedB = 0; return profitCinstedB; } } else { profitCinstedB = 0; return profitCinstedB; } }//end of method save when buy C insted B //This method will display the profit when they buy C not B public static void displayCB(double profitCandB) { if (profitCandB > 0) System.out.printf("You will save $%,.2f if you buy package C\n",profitCandB); else System.out.println(""); } }// end of class /* Get the letter of package from user get the hours from the user if pakage A and more than 10 hour than Amoney+ (more hour per 10 * $2) else if (Bmoney and more than 20 hour) than Bmoney+ (more hour per 20 * $1) else Cmoney; display total charges profit if they buy B insted of A =(priceA + ((hour - 10)* extraA)) - priceB //save when hour greater than 12 profit if they buy C insted of A =(priceA + ((hour - 10)* extraA)) - priceC //save when hour greater than 16 profit if they buy C insted of B =(priceB + ((hour - 20)* extraB)) - priceC
Image of page 5
//save when hour greater than 27 */
Image of page 6
  • Fall '15
  • English-language films, American films, public class, public static void, char cpackage

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern