Just some advice on my first program in java.
posted Today 05:01:36
Hi All, Well, I have been studying Java for just over a month and I have almost finished my first program. But as you see I am stuck. Below is a copy of the code for a program I wrote MANY years ago in Tandy Basic, written in Java. I don't understand why my System.out.println call won't work. A word of why would help. I don't want you to fix it just let me know how to fix it myself. Any help would be great. Here is the code:
Code:
/**
*
*/
package EggsProfitLoss;
/**
* @author Michael Humphreys
* This program was origanaly written in TandyBasic many years ago
* This is an updated java program.
*
*/
public class chickens {
public static void main(String [] args) {
int chickens = 110;
int hens = 100;
int numberOfEggsLaid = 110;
double costOfFeed = 25.00;
double cost;
double costOfEggs = cost*chickens;
cost = costOfFeed / chickens;
System.out.println("Number Of Hens =") = hens;
System.out.println("Number Of Eggs Laid =") = numberOfEggsLaid;
System.out.println("CostOf Feed =") = costOfFeed;
System.out.println("Cost Of Eggs = ") = cost;
System.out.println("Profit Or Loss = ") = costOfFeed-cost;
}
}