9 August 2010, 3:05 am
I have windows 7(64bit) operating system. My current path is “C:\Program Files (x86)\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Java\jdk1.6.0_21\bin” Java –version Java version “1.6.0_21” Java SE Runtime Environment Java HotSpot 64-Bit Server VM Below is your code and errors which I’m facing. import java.io.*; import java.text.NumberFormat; public class Mortgage { public static void main(String args[]) throws IOException { BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); double principal, rate, ratePercent; int years, n; final int paymentsPerYear = 12; final int timesPerYearCalculated = 12; double effectiveAnnualRate; double payment; NumberFormat currency = NumberFormat.getCurrencyInstance(); System.out.print("How much are you borrowing? "); principal = Double.parseDouble(keyboard.readLine()); System.out.print("What's the interest rate? "); ratePercent = Double.parseDouble(keyboard.readLine()); rate = ratePercent / 100.00; System.out.print("How many years are you taking to pay? "); years = Integer.parseInt(keyboard.readLine()); System.out.println("------------------------------"); n = paymentsPerYear * years; effectiveAnnualRate = rate / paymentsPerYear; payment = principal * (effectiveAnnualRate / (1 - Math.pow(1 + effectiveAnnualRate, -n))); System.out.print("Your monthly payment is "); System.out.println(currency.format(payment)); System.out.println(); } } --------------------Configuration: Chapter03_Example01 - JDK version 1.6.0_21 - -------------------- C:\Program Files (x86)\Xinox Software\JCreatorV3LE\MyProjects\Chapter03_Example01\Mortgage.java:4: error while writing Mortgage: C:\Program Files (x86)\Xinox Software\JCreatorV3LE\MyProjects\Chapter03_Example01\Mortgage.class (Access is denied) public class Mortgage { ^ 1 error Process completed. ________________________________________________________________________________________________________________________________________________ class SnitSoft { public static void main(String args[]) { double amount; amount = 5.95; amount = amount + 25.00; System.out.print("We will bill $"); System.out.print(amount); System.out.println(" to your credit card."); } } --------------------Configuration: Chapter06_Listing01 - JDK version 1.6.0_21 - -------------------- javac: file not found: C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\Chapter06_Listing01\SnitSoft.java Usage: javac use -help for a list of possible options Process completed.... Read More »