Basic Java code help

0 comments

How to fix java code?

Problem
Sparky Power works for Shockingly Good Electrical Company. She installs electrical boxes in commercial 
buildings. For each building she works in there is a trip charge of $125.00 and an additional charge of $51.00 for each box she installs. We need to write a program that computes the revenue for each month that Ms. Power works. For example, if 937 boxes were installed in 31 buildings Ms. Power would generate $51,662.00.
BEHAVIOR: 
The program should display on the screen a prompt for the number of buildings that Ms. Power worked in and the total number electrical boxes that she installed. The user should enter these values from the keyboard. The program should compute and display on the screen the total amount of revenue resulting from these building installations.
Here is the SS of the code so you can see the errors http://prntscr.com/1d2gvg
in writing 
import java.util.Scanner;

public class EggBasket2
{
public static void main(String[] args)
{
int buildingNumber, electricalBoxes;
final double BUILDING_CHARGE=125;
final double ELECTRICAL_BOX_COST=51;
double totalRevenue;
double buildingRevenue;
double boxRevenue;

Scanner keyboard = new Scanner(System.in);
System.out.println(“Enter the number of building:”);
buildingNumber = keyboard.nextInt( );
System.out.println(“Enter the number of electrical boxes:”);
electricalBoxes = keyboard.nextInt( );

Compute buildingRevenue= buildingNumber * BUILDING_CHARGE;
Compute boxSum= ELECTRICAL_BOX_COST * electricalBoxes;
Compute total= buildingRevenue + boxRevenue

System.out.println(“totalRevenue”);

}
}

for more info here is a link
http://www.nvcc.edu/home/dfranssell/CSC130/week1%20Problem%20lecture%20handout.pdf

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}