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;
}
}
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!
Learn more about our help with Assignments:
JavaJSPJSF