Error Messages when Compiling...
Please Login to Remove!
I'm experiencing difficulty compiling a Mortage Loan Calculator that I want to convert from an Excel file that I've been using for several months, to my Blackberry, and I really need some help to understand and to resolve the problems.
I'm trying to learn BB Java and have spent a lot of time going over the API and trying to find some samples, but without some help from someone who understands the process, it is difficult and extremely frustrating.
As an aid to understanding what I am trying to do, I've included a notation showing the calculations that I am trying to create as well as an sample user input with the expected results in my Main Screen,
Here's the application as well as a copy of the error messages I'm receiving when I attempt to compile the application.
Thank you for your help!!
Error Messages:
Building LOANCALCULATOR
C:\Research In Motion\BlackBerry JDE 4.5.0\bin\rapc.exe -quiet import="..\..\..\Research In Motion\BlackBerry JDE 4.5.0\lib\net_rim_api.jar" codename=StringSample StringSample.rapc warnkey=0x52424200;0x52525400;0x52435200 C:\AFMCQD\TESTAPPS\LOANCALC\com\res\1.png C:\AFMCQD\TESTAPPS\LOANCALC\com\res\2.png C:\AFMCQD\TESTAPPS\LOANCALC\com\res\3.png C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a C:\AFMCQD\TESTAPPS\LOANCALC\com\src\LoanApp.java
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:62: cannot find symbol
symbol : constructor EditField(java.lang.String,double)
location: class net.rim.device.api.ui.component.EditField
tointField = new EditField("Applied to Interest: $" , + ee);
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:64: cannot find symbol
symbol : constructor EditField(java.lang.String,double)
location: class net.rim.device.api.ui.component.EditField
toosamtField = new EditField("Applied to Interest: $" , + ff);
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:66: cannot find symbol
symbol : constructor EditField(java.lang.String,double)
location: class net.rim.device.api.ui.component.EditField
boField = new EditField("Balance Owing: $" , + gg);
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:74: cannot find symbol
symbol : method pow(float,int)
location: class net.rim.device.api.util.MathUtilities
aa = MathUtilities.round((MathUtilities.pow(1 + Float.parseFloat(mifField.getText()), 12) - 1) * 10000) / 10000;
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:74: cannot find symbol
symbol : method round(int)
location: class net.rim.device.api.util.MathUtilities
aa = MathUtilities.round((MathUtilities.pow(1 + Float.parseFloat(mifField.getText()), 12) - 1) * 10000) / 10000;
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:76: cannot find symbol
symbol : method pow(float,int)
location: class net.rim.device.api.util.MathUtilities
bb = MathUtilities.pow(MathUtilities.pow((1 + (Float.parseFloat(airField.getText()) / 2)), 2), 1 / 12) - 1;
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:80: cannot find symbol
symbol : method pow(float,float)
location: class net.rim.device.api.util.MathUtilities
dd = (Float.parseFloat(ipField.getText()) * Float.parseFloat(mifField.getText()))/ MathUtilities.pow(1 - (1 + Float.parseFloat(mifField.getText())), -Float.parseFloat(amField.getText()));
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:82: cannot find symbol
symbol : method round(float)
location: class net.rim.device.api.util.MathUtilities
ee = MathUtilities.round(Float.parseFloat(pmpField.getT ext()) * 100) / 100;
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:84: cannot find symbol
symbol : method round(float)
location: class net.rim.device.api.util.MathUtilities
ff = MathUtilities.round(Float.parseFloat(pmpField.getT ext()) - Float.parseFloat(tointField.getText()));
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:86: cannot find symbol
symbol : variable boFieldField
location: class com.src.CalcScreen
gg = MathUtilities.round(Float.parseFloat(boFieldField. getText()) - Float.parseFloat(toosamtField.getText()));
^
C:\AFMCQD\TESTAPPS\LOANCALC\com\src\CalcScreen.jav a:86: cannot find symbol
symbol : method round(float)
location: class net.rim.device.api.util.MathUtilities
gg = MathUtilities.round(Float.parseFloat(boFieldField. getText()) - Float.parseFloat(toosamtField.getText()));
^
11 errors
Error!: Error: java compiler failed: javac -source 1.3 -target 1.1 -g -O -d C:\Users\ALEXMC~1\AppData\Local\Temp\rapc_7d659fd0 .dir -boot ...
Error while building project
package com.src;
import net.rim.device.api.ui.UiApplication;
public class LoanApp extends UiApplication {
public static void main(String[] ags) {
LoanApp theApp = new LoanApp();
theApp.enterEventDispatcher();
}
public LoanApp() {
pushScreen(new CalcScreen());
}
}
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FocusChangeListener;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.text.TextFilter;
import net.rim.device.api.ui.text.NumericTextFilter;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.util.MathUtilities;
public class CalcScreen extends MainScreen implements FocusChangeListener {
double aa = 0, bb = 0, cc = 0, dd = 0, ee = 0, ff = 0, gg = 0;
// USER INPUT //
EditField ipField; // $10,000.00
EditField airField; // 10.00%
EditField ayField; // 3
// CALCULATIONS //
EditField earField; // aa = ROUND((1+mthlyintfactor)^12-1,4)....Result = // 10.25%
EditField mifField; // bb = ((1+(annintrate/2))^2)^(1/12)-1).....Result = // 0.008164846%
EditField amField; // cc = ayField*12.....Result = 36 mths
EditField pmpField; // dd = (ipField * mifField)/(1-(1 + mifField)^(- //amField)) ..... Result = $1818.04
EditField tointField; // ee = ROUND(mifField * Outstanding ,2).....Result = // $289.56
EditField toosamtField; // ff = pmpField - tointField..... Result = $1528. //(Payment #1)
EditField boField; // gg = boField - toosamtField; ......Result = $98471.53
public CalcScreen() {
TextFilter numeric = new NumericTextFilter(NumericTextFilter.ALLOW_DECIMAL) ;
ipField = new EditField("Initial Principal: $ ", "");
add(ipField);
airField = new EditField("Annual Interest Rate: % ", "");
airField.setFilter(numeric);
add(airField);
ayField = new EditField("Amortization Period: (yrs) ", "");
ayField.setFilter(TextFilter.get(TextFilter.NUMERI C)); // no decimal
add(ayField);
add(new SeparatorField());
earField = new EditField("Effective Annual Interest Rate: %" + aa, "");
earField.setFilter(numeric);
add(earField);
mifField = new EditField("Monthly Interest Factor: " + bb, "");
add(mifField);
amField = new EditField("Months to Amortization: " + cc, "");
add(amField);
// Monthly Payment to be displayed automatically after Monthly Interest Factor has been calculated
pmpField = new EditField("Periodic Monthly Payment: $" + dd, "");
add(pmpField);
tointField = new EditField("Applied to Interest: $" , + ee);
toosamtField = new EditField("Applied to Interest: $" , + ff);
boField = new EditField("Balance Owing: $" , + gg);
}
public void focusChanged(Field field, int eventType) {
if (eventType == FOCUS_LOST) {
if (field == pmpField) {
aa = MathUtilities.round((MathUtilities.pow(1 + Float.parseFloat(mifField.getText()), 12) - 1) * 10000) / 10000;
bb = MathUtilities.pow(MathUtilities.pow((1 + (Float.parseFloat(airField.getText()) / 2)), 2), 1 / 12) - 1;
cc = Float.parseFloat(ayField.getText()) * 12;
dd = (Float.parseFloat(ipField.getText()) * Float.parseFloat(mifField.getText()))/ MathUtilities.pow(1 - (1 + Float.parseFloat(mifField.getText())), -Float.parseFloat(amField.getText()));
ee = MathUtilities.round(Float.parseFloat(pmpField.getT ext()) * 100) / 100;
ff = MathUtilities.round(Float.parseFloat(pmpField.getT ext()) - Float.parseFloat(tointField.getText()));
gg = MathUtilities.round(Float.parseFloat(boFieldField. getText()) - Float.parseFloat(toosamtField.getText()));
}
}
}
}
|