Jessica Madden

Greenhorn
+ Follow
since Nov 02, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jessica Madden

I am having a problem with this program I am writing and I was wondering if anyone can help. Here is the part that is getting an error:
eof = false;
while (!eof){
name = br.readLine();
if (name == null){
eof = true;
} else {
sWeeklySales = br.readLine();
weeklySales = Double.parseDouble(sWeeklySales);
if (weeklySales >= 2000){
commRate = 5.0/100;
numEarnComm = numEarnComm + 1;
msg = "";
} else {
commRate = 0;
numNotEarnComm = numNotEarnComm + 1;
msg = msg + "*";
}//end if

commSales = weeklySales * commRate;
weeklyPay = commSales + baseSalary;
totComm = totComm + commSales;

It says "Process Complete" but when I run it, it says:
Exception in thread "main" java.lang.NullPointerException
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:9
80)
at java.lang.Double.parseDouble(Double.java:220)
at Haberdasher.main(Haberdasher.java:53)
Press any key to continue...
Does anyone know why it isn't accepting the conversion? thanks
[ November 02, 2003: Message edited by: Jessica Madden ]
20 years ago