63 195
Assignments Done
99,3%
Successfully Done
In July 2018

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;
}
}
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions