Go to Post Maybe LabView needs to have a watchdog for goofy programmers... - johncap100 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Spotlight this post!  
Unread 30-03-2005, 11:08
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: Java headache problem

Quote:
Originally Posted by MisterX - edited in RED
feast your eyes on 31 errors of pure Java!

public class SellStock
{
double price;
double numbers;
double value;
double commission;
double rate;
double proceeds;

public SellStock()
{
//these variables need to be.
price = 0;
numbers = 0;
value = 0;
commission = 0;
rate = 0;
proceeds = 0;

}
public void addPrice(double count)
{
price = price + count;
}
public void addNumbers(int count)
{
numbers = numbers + count;
}
public void addRate(double count)
{
rate = rate + count;
}
public void addValue()
{
value = price * numbers; //don't miss semi-colons
}
public void addCommission (double rate)
{
commission = value * (rate/100);
}
public double getProceeds()
{
return value - commission;
}
}
/*
public
*/
class SellStockTest
{
public static void main(String[] args)
{
SellStock iSellStock = new SellStock();
iSellStock.addPrice(10.125);
iSellStock.addNumbers(11);
iSellStock.addCommission(1.5);
double totalValue = iSellStock.getProceeds();
System.out.print("This program calculates the net proceeds from a sale of stock to be:");
System.out.println(totalValue/*getProceeds*/);
}
}
Those are the only errors that were found with the compiler I used...
Hope its better
__________________
- from B B frank

 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Encoder Problem AIBob Electrical 3 20-02-2005 22:20
Programming Problem: Extremely Frustrating chantilly_team Programming 19 12-02-2005 23:00
Java Books Yan Wang Programming 1 27-12-2002 16:26
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44


All times are GMT -5. The time now is 00:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi