Answer to Question #53588 in Java | JSP | JSF for Hannah

Question #53588
I need help debugging this program for calculating a persons tip:

public class calculatetip
{
public static void main(String[] args)
{
double mycheck = 29.95, yourcheck = 39.95, mytip, yourtip;
System.out.println("Tips are");
calctip(double mycheck);
System.out.printf("My tip should be at least %.2f\n", tip);
calctip(double yourcheck);
System.out.printf("Your tip should be at least %.2f\n", tip);
}

public static void calctip()
{
double tip;
tip = bill * .20;
return tip;
}
}
1
Expert's answer
2015-07-23T01:54:06-0400
public class calculatetip {
public static void main(String[] args) {
double mycheck = 29.95, yourcheck = 39.95, mytip, yourtip;
System.out.println("Tips are");
mytip = calctip(mycheck);
System.out.printf("My tip should be at least %.2f\n", mytip);
yourtip = calctip(yourcheck);
System.out.printf("Your tip should be at least %.2f\n", yourtip);
}

public static double calctip(double bill) {
double tip;
tip = bill * .20;
return tip;
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS