Evening all.
I'm a student trying to get my head round a little bit of code. I'm fluent with vb.net, c, html & sql with a little oracle but never used Java before..
so heres my code:
/*
* gasbill.java
*
* Created on 23 September 2006, 22:26
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package gasbill02;
/**
*
* @author Buck
*/
import.java.util.scanner;
public class gasbill {
/**
* Creates a new instance of gasbill
*/
public gasbill() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Input Data
Scanner kybd = new Scanner(System.in);
int accNum, unitNum, unitcost;
double totalcost;
System.out.println("Enter the account number: ");
accNum = kybd.nextInt();
System.out.println("Enter the units used : ");
unitNum = kybd.nextInt();
System.out.println("Enter the cost per unit : ");
unitcost = kybd.nextInt();
totalcost = unitNum * costunit;
// Output bill
System.out.println("Customer Account Number is : " + accNum);
System.out.println("Units of gas used is : " + unitNum);
System.out.println("Total cost of bill is : " + totalcost);
}
}
Only problem I'm having is that I get the line "import.java.util.scanner;" is underlined in red (Using Netbeans). and I get the following compile error:
Compiling 1 source file to D:\Uni\Java\Portfolio\Electricity\GasBill02\GasBill02\build\classes
D:\Uni\Java\Portfolio\Electricity\GasBill02\GasBill02\src\gasbill02\gasbill.java:16: <identifier> expected
import.java.util.scanner;
D:\Uni\Java\Portfolio\Electricity\GasBill02\GasBill02\src\gasbill02\gasbill.java:16: '.' expected
import.java.util.scanner;
2 errors
BUILD FAILED (total time: 0 seconds)
Please help?! What am I doing wrong. My lecturer has said the code seems fine and he can't figure it out. He's suggested starting again without copying and pasting from my old code as apparantly this causes issues sometimes??? So I have done exactly that, twice actually... No fix yet?
Thanks in anticipation!!!