post #1 of 1
Thread Starter 
I'm supposed to write a program for my class that needs me to define a class for Mobile Phones. I have created a class method that compiles just fine but my main method has 6 errors and won't compile. Any help would be appreciated Thanks in advance.

This is my console code which compile just fine:

//Mobilephone.java
//Mobilephone Class


public class Mobilephone
{
private Double itemNumber;
private String phoneName;
private String productDepartment;
private Double units;
private Double price;




public Double getitemNumber()
{
return itemNumber;
}


public String getphoneName()
{
return phoneName;
}

public String getproductDepartment()
{
return productDepartment;
}

public Double getunits()
{
return units;
}

public Double getprice()
{
return price;
}




public void Mobilephone(Double itemNumber, String phoneName, String productDepartment, Double units, Double price)
{
this.itemNumber = itemNumber;
this.phoneName = phoneName;
this.productDepartment = productDepartment;
this.units = units;
this.price = price;
}

public String Mobilephoneinfo()
{
return itemNumber + phoneName + productDepartment + units + price;
}
}

This is my main code that has 6 errors and I can't figure it out:

//Phoneinventory.java
//Program that shows inventory information and total inventory value
import java.util.Scanner;



public class Phoneinventory
{


private static final int INVENTORY_SIZE = 20;
private Mobilephone [] Mobilephones;


public Phoneinventory()
{
Mobilephone = new Mobilephone [INVENTORY_SIZE];
}



private static void Phoneinventory()
{
for (int i = 0; i
{

Scanner input = new Scanner(System.in);
System.out.println("Welcome to the Electronics Department");
System.out.println();



System.out.println("Product Item Number");
Double itemNumber = console.next();

System.out.println("Phone Name");
String phoneName = console.next();

System.out.println("Product Department");
String productDepartment;

System.out.println("Units in stock");
Double units = console.next();

System.out.println("Price per unit");
Double price = console.next();


Mobilephone = new Mobilephone(itemNumber, phoneName, productDepartment, units, price);
}

public static void main(String[] args)
{
Phoneinventory();



{
double totalValue = units * price;

System.out.printf( "Total Value: $%.2f\n", (totalValue));
System.out.println();



return totalValue;
//total inventory value
}
}


}

At this point I'm just supposed to create a class that has those variables in the array and return a total value for the inventory. any help would be appreciated. Thanks again in advance.
Asus G75VX
(10 items)
 
   
CPUGraphicsRAMHard Drive
i7 3630qm 670mx 16gb 1600mhz 750gb 7200rpm 
Hard DriveCoolingOSMouse
HGST 1TB 7200rpm Cooler Master SF-19 Windows 8.1 Steel Series Sensei 
Mouse PadAudio
Steel Series QcK Steel Series Siberia V2 
CPUMotherboardGraphicsRAM
Intel i5 2500k Gigabyte Z77 UD5H Sapphire 7950 Vapor-X G. Skill 16 gb X Series 1600 
Hard DriveOptical DriveCoolingOS
Western DIgital 1tb Lite On Thermaltake 2.0 Performer Windows 7 
MonitorKeyboardPowerCase
HP  Cooler Master Devastator Thermaltake TR2 RX 850 Black Widow NZXT Phantom 410 
Mouse
Cooler Master Devastator 
  hide details  
Reply
Asus G75VX
(10 items)
 
   
CPUGraphicsRAMHard Drive
i7 3630qm 670mx 16gb 1600mhz 750gb 7200rpm 
Hard DriveCoolingOSMouse
HGST 1TB 7200rpm Cooler Master SF-19 Windows 8.1 Steel Series Sensei 
Mouse PadAudio
Steel Series QcK Steel Series Siberia V2 
CPUMotherboardGraphicsRAM
Intel i5 2500k Gigabyte Z77 UD5H Sapphire 7950 Vapor-X G. Skill 16 gb X Series 1600 
Hard DriveOptical DriveCoolingOS
Western DIgital 1tb Lite On Thermaltake 2.0 Performer Windows 7 
MonitorKeyboardPowerCase
HP  Cooler Master Devastator Thermaltake TR2 RX 850 Black Widow NZXT Phantom 410 
Mouse
Cooler Master Devastator 
  hide details  
Reply