Copy link to clipboard
Copied
Hello, all. I'm in a Java Programming I class with a Debugging Exercise 3-1. Right now, we're learning about methods, returns, classes, objects, etc. I have tried multiple ways to get this to execute properly, but I can't figure it out. I've played with the code so much that I don't remember any specific problems that I've had.
This is the original code:
// This class calculates a waitperson's tip as 15% of the bill
public class DebugThree1
{
public static void main(String args[])
{
double myCheck = 50.00;
double yourCheck = 19.95;
System.out.println("Tips are");
calcTip(myCheck);
calctip(yourcheck);
}
public void calcTip(double bill)
{
final double RATE = 0.15;
double tip;
tip = check * RATE;
System.out.println("The tip should be at least " + tip);
}
}
The current error messages say:
DebugThree1.java:9: error: non-static method calcTip(double) cannot be referenced from a static context
calcTip(myCheck);
^
DebugThree1.java:10: error: cannot find symbol
calctip(yourcheck);
^
symbol: variable yourcheck
location: class DebugThree1
DebugThree1.java:16: error: cannot find symbol
tip = check * RATE;
^
symbol: variable check
location: class DebugThree1
3 errors
Error: Could not find or load main class DebugThree1
I have noticed the small typos included.
1 Correct answer
You will find that not many contributors to this Dreamweaver forum will be able to find a solution to your Java problem. Nor should they because the answer needs to be supplied by you.
Having said that, have a look at https://github.com/mscoley169/school/blob/master/workspace/DebugThree1/src/edu/nashcc/c3dbg/DebugThree1.java
Copy link to clipboard
Copied
You will find that not many contributors to this Dreamweaver forum will be able to find a solution to your Java problem. Nor should they because the answer needs to be supplied by you.
Having said that, have a look at https://github.com/mscoley169/school/blob/master/workspace/DebugThree1/src/edu/nashcc/c3dbg/DebugThr...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
JAVA isn't as popular for web programming as it once was. These days, DW doesn't support it.

