Java programming question…?

September 22nd, 2008 at 11:17pm Under Forum

Java programming question…?
// the following program has a error statement that I dont undestand
// how to fix this (Im a total noob programmer)…any help?
/*
3 errors found:
File: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java [line: 18]
Error: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java:18: cannot find symbol
symbol : variable c1
location: class CombinationLockTest
File: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java [line: 21]
Error: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java:21: cannot find symbol
symbol : variable c1
location: class CombinationLockTest
File: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java [line: 24]
Error: C:\Users\Jonathan\Documents\School\Computer Science\lab-8-combinationLock\CombinationLockTest.java:24: cannot find symbol
symbol : variable c1
location: class CombinationLockTest
*/

import java.util.Scanner;
public class CombinationLockTest {
public static void main(String[] args){
Scanner kb = new Scanner(System.in);
String a, b, c;
System.out.println(“This is a Combination Lock tester start ”
+”by imputing any letter or number and pressing enter…”);
a = kb.next();
System.out.println(“imput another letter or number:”);
b = kb.next();
System.out.println(“imput the final letter of number:”);
c = kb.next();
CombinationLock cl = new CombinationLock(a+b+c);
System.out.println(“Now that you have made a combonation lock try opening it.”);
System.out.println(“imput first: “);
String x,y,z;
x=kb.next();
c1.setPosition(x);
System.out.println(“imput second: “);
y=kb.next();
c1.setPosition(y);
System.out.println(“imput third: “);
z=kb.next();
c1.setPosition(z);
}
}

public class CombinationLock {
private boolean myState; // myState is true if the lock is open and
// false otherwise
private String myCombination;// A three character string
// representing the combination
private String myPositions; // A string that represents the positions
// set on the dial. This string can
private int num = 0; // be any length.
/*
Constructs a lock with a given combination. The state is initially
closed (false) and the positions is (are?) an empty string (“”).
@param combination is a string with three uppercase letters A..Z
*/
public CombinationLock(String combination){
myCombination = combination;
myPositions = “”;
myState = false;
}
/*
Set the dial to a position. See chart above for an example.
@param position is a string consisting of a single uppercase letter A..Z
*/
public void setPosition(String aPosition){
myPositions += aPosition;
num++; if(num == 3){
num = 0; unlock(); myPositions = “”;
System.out.println(“Now to find out if that combo was correct type ‘open’”);
}
}
/*
Try unlocking the lock. If the lock is closed and the length of the
positions is >= 3, test to see if the combination is equal to the
last three positions. If they are equal, open the lock otherwise
leave it unchanged.
*/
public void unlock(){
if(myPositions.equals(myCombination))myState = true;
else myState = false;
}
/*
Check whether the lock is unlocked.
@return true if the lock is currently open.
*/
public boolean isOpen(){
return myState;
}
/*
Close the lock and start over by setting the state and the
positions to the empty string “”
*/
public void startOver(){
myState = false;
myCombination = “”;
myPositions = “”;
}
}

omg lol i just found out that the problem was that java didn’t like my naming my object c1 so i changed it to combo and now it works thx for your time anyways…

Best answer:

Don’t worry, happens to all of us.

By Barcode Scanner 1 comment

java ignore case problem?

August 31st, 2008 at 08:02am Under Forum

java ignore case problem?
I’m trying to ignore when the user inputs uppercase letters and I tried out my code by typing a word into the program with uppercase but it doesnt convert it and it just goes to my message saying “please enter the word correctly”
can anyone help me with this

import java.util.*;

public class sport
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{

double quantity; // Declare variables
double setup;
int demand;
double inventory;

String products;

System.out.println(“Welcome to the sport program.”);
System.out.println();
System.out.println(“Please enter the sport name: “);
products = console.next();
if (products.equalsIgnoreCase(“football”)){
String products = products.toLowercase;
System.out.println(“Input the demand rate: “);
}
else
System.out.println(“You entered ” + products);
System.out.println(“Please enter the product name correctly!”);

}
}

Best answer:

You have several problems:

1) String products = products.toLowercase;

This is wrong, you do not use “String” again, you already declared the variable ‘products’ above. Now your simply trying to do an assignment, it should be :
products = products.toLowerCase();

2) “toLowercase” needs to be capitalized & needs parentheses () because its a method.

use “.toLowerCase()” instead.

3) Lastly you need to use brackets{} around your if/else statement if its more than 1 line.

if ( products.equalsIgnoreCase(“football”) )
{
String products = products.toLowercase;
System.out.println(“Input the demand rate: “);
}//end if

else
{
System.out.println(“You entered ” + products);
System.out.println(“Please enter the product name correctly!”);
} //end else

Otherwise
System.out.println(“Please enter the product name correctly!”);
will execute every single time…. Good Luck

By Barcode Scanner Add comment

Using Java to print a rectangular pattern (please check if my code is right)?

April 16th, 2008 at 12:57pm Under Forum

Using Java to print a rectangular pattern (please check if my code is right)?
/* Program Statement:
* This program will print a filled rectangular pattern using the character c, that is
* width characters wide, and height characters high.
ex. width input is 5, height input is 3. output is:
ccccc
ccccc
ccccc
*/

import java.util.*;
public class RectangularCPattern
{
public static void main(String[] args) // Main method
{
printRect(c,width,height);
}

public static void printRect(char c, int width, int height)
{
Scanner get = new Scanner(System.in);
width=get.nextInt();
height=get.nextInt();

for (c=0; width>c; c++)
{

System.out.print(“c”);
System.out.println();

for (c=0; height>c; c++)
{
System.out.println(“c”);
}
}

} //end method printRect
}//end main

I don’t know why i keep getting these errors:
cannot find symbol
symbol : variable c
location: class RectangularCPattern
cannot find symbol
symbol : variable width
location: class RectangularCPattern
cannot find symbol
symbol : variable height
location: class RectangularCPattern
we have to use another method (our assignment is based on it) and the problem occured where u said it was

printRect(c,width,height);

from the main

Best answer:

c, width, and height are not declared in your main. Another suggestion that I would make is to simplify your code and not pass things to another method. Instead, simply contain it all in your main.

public static void main(String[] args)
{
int height;
int width;
Scanner input = new Scanner(System.in);
height = input.nextInt();
width = input.nextInt();
for (int i=0; i {
for (int j=0; j {
System.out.print("C");
}
System.out.println();
}
}

By Barcode Scanner Add comment

Help with java classes!! I cannot make my program work!!!?

April 10th, 2008 at 09:19am Under Forum

Help with java classes!! I cannot make my program work!!!?
Here’s the class I want to make:

import java.util.*;
public class ClaseFecha {

//declaracion de variables

String dia, mes;
public void SetDia(String d)
{
dia=d;
}

public String getDia() {
return dia;
}

public void setMes(String m) {
mes=m;
}

public String getMes() {
return mes;
}

public String toString() {
return dia+”-”+mes;
}
}

Here is the main:

import java.util.*;
public class Fecha {
public static Scanner tecla=new Scanner(System.in);
public static void main(String[] args) {

//Crea el objeto con el metodo constructor.

Fecha f=new Fecha();
String d,m;
m=”0″;
d=”0″;
d.setDia(“06″);
m.setMes(“10″);
System.out.println(“La fecha de hoy es: “+f.toString());

//modificar
System.out.print(“Qué día es hoy (dd)”);
d=tecla.nextLine();
d.setDia(d);
System.out.print(“Qué mes es hoy (mm)”);
m=tecla.nextLine();
m.setMes(m);

System.out.println(“Tu Fecha modificada: “+f.toString());
}

}

I get this errors:
Fecha.java:19: cannot find symbol
symbol : method setDia(java.lang.String)
location: class java.lang.String
d.setDia(“06″);
^
Fecha.java:20: cannot find symbol
symbol : method setMes(java.lang.String)
location: class java.lang.String
m.setMes(“10″);
^
Fecha.java:26: cannot find symbol
symbol : method setDia(java.lang.String)
location: class java.lang.String
d.setDia(d);
^
Fecha.java:29: cannot find symbol
symbol : method setMes(java.lang.String)
location: class java.lang.String
m.setMes(m);
^
4 errors

Best answer:

You are declaring d and m as Strings and start by setting them equal to “0″. That is fine. But then you are trying to use methods as if they were ClaseFecha objects. If you want to use the setDia, getDia, setMes, getMes methods, you need to declare d and m as new ClaseFecha objects. Also, when you do that, you will not be able to use the d = “0″ and m = “0″ statements. But that is what the setDia and setMes methods are for, if I understand your code.

Your errors are because you are declaring variables as one type, but trying to use methods as if they were a different object type.

By Barcode Scanner Add comment

Why can I not use variables in Java?

April 8th, 2008 at 11:45am Under Forum

Why can I not use variables in Java?
I tried some fairly simple code:

import java.util.*;
//import java.util.Scanner;
//import java.lang.String;

public class ZellersCongruence {

public static void main(String args[]){

int DayOfWeek;
int DayOfMonth;
int Month;
int YearOfCentury;
int Century;
String Date;

Scanner inputVal = new Scanner(System.in);

System.out.println(“Please enter the day of the month”);
DayOfMonth = in.nextLine();

System.out.println(“Please enter number of the month”);
Month = in.nextLine();

System.out.println(“Please enter the year”);
YearOfCentury = in.nextLine();

And Command Prompt keeps spitting out:

C:\Documents and Settings\Jos\My Documents\Homework\College\Puting>javac Zellers
Congruence.java
ZellersCongruence.java:20: cannot find symbol
symbol : variable in
location: class ZellersCongruence
DayOfMonth = in.nextLine();
^
ZellersCongruence.java:23: cannot find symbol
symbol : variable in
location: class ZellersCongruence
Month = in.nextLine();
^
ZellersCongruence.java:26: cannot find symbol
symbol : variable in
location: class ZellersCongruence
YearOfCentury = in.nextLine();
^
3 errors

Any idea why this keeps happening? If you need the rest of the code then I can provide it :)
Thanks for reading :)
Thanks for the help, I was just pasting that bit from old code. However there’s a new problem, to do with incompatible types, something about expecting an integer :S

C:\Documents and Settings\Jos\My Documents\Homework\College\Puting>javac Zellers
Congruence.java
ZellersCongruence.java:19: incompatible types
found : java.lang.String
required: int
DayOfMonth = inputVal.nextLine();
^
ZellersCongruence.java:22: incompatible types
found : java.lang.String
required: int
Month = inputVal.nextLine();
^
ZellersCongruence.java:25: incompatible types
found : java.lang.String
required: int
YearOfCentury = inputVal.nextLine();
^
3 errors

C:\Documents and Settings\Jos\My Documents\Homework\College\Puting>

Best answer:

It’s not working because your variable (‘in’) doesn’t exist. You didn’t declare it anywhere.

Also, you commented out a few imports that are used in the program.

By Barcode Scanner 2 comments

Java Barcode Scanner + Drivers?

March 5th, 2008 at 08:20pm Under Forum

Java Barcode Scanner + Drivers?
Hi there! I need to buy a Barcode scanner (similar to the ones you get in supermarkets) and the drivers. I need to also be able to program it in Java with the 1.6 JDK. It would also be good if it worked on mac. I am in the UK. Thanks!

Best answer:

I played around a bit with an OpenSource project called Barbecue. Bear in mind there are different kinds of barcodes, but, Barbecue does generate the same bar code the mobile phones over in Europe can read. I know that much.

By Barcode Scanner Add comment

Java error- Help needed!?

February 29th, 2008 at 01:24am Under Forum

Java error- Help needed!?
Im working on a program and am getting the following error message of: “can not find symbol variable i”.

Here is my code:

import java.util.Scanner;

class jets24
{
public static void main (String[]args)
{
Scanner input= new Scanner (System.in);

//variables//

int TotalLuxurySeats = 4 ;
int TotalExecutiveSeats = 6 ;
int Option = 0 ;
int LuxurySeatsSold=0;
int ExectutiveSeatsSold=0;
String[] CustomerName= new String [10];

// seat objectives within the array//

for(int i=0; i<10; i++)
{
if (i<4)
CustomerName[i]=new String ("Luxury");
else
CustomerName[i]=new String ("Exectutive");
}
while(Option!=4 || LuxurySeatsSold>0 || ExectutiveSeatsSold>0)
{
System.out.println(” Hello and welcome to CCNJet! “);

System.out.println(” “);

System.out.println(” Please select an option from the following menu “);
System.out.println(” “);
System.out.println(” 1. Book a luxury seat “);
System.out.println(” 2. Book an exectutive seat “);
System.out.println(” 3. Display seat details/availability “);
System.out.println(” 4. Exit “);
Option=input.nextInt();

if ((Option==1) && (LuxurySeatsSold<4))
{
System.out.println(" Please enter your name ");
CustomerName[LuxurySeatsSold]=input.next();
System.out.println(" ");
System.out.println(" Thank you for your luxury seat order " + CustomerName[LuxurySeatsSold] + " You have seat number " + (LuxurySeatsSold + 1));
LuxurySeatsSold++;
LuxurySeatsSold=TotalLuxurySeats -1;
}
if ((Option==2) && ExectutiveSeatsSold<4)
{
System.out.println(" Please enter your name ");
CustomerName[ExectutiveSeatsSold]=input.next();
System.out.println(" ");
System.out.println(" Thank you for your exectutive seat order " + CustomerName[ExectutiveSeatsSold] + " You have seat number " + (ExectutiveSeatsSold+ 1));
ExectutiveSeatsSold++;
ExectutiveSeatsSold=TotalExecutiveSeats -1;
}
if (Option==3)
{
System.out.println(" Here is a report of available/unavailable seats on the aircraft ");
System.out.println("");

System.out.println(" Luxury seats ");
while (CustomerName[i]!=null) // can not find symobol variable i//
for (int i=0;j<4;i++)
{
if(customerName[i]==null) break;
System.out.println("Seat Number: " + i + "Name: " + customerName[i]);

}
System.out.println("Executive Seats");
while(CustomerName[k]!=null)
for( k=4;l<10;k++)
{
if(customerName[k]==null) break;

System.out.println("Seat Number : " + k + "Name: " + customerName[i]); }

}
}
if (Option==4)
{
System.out.println("=============");
System.out.println(" Good bye,thanks for looking!");
System.out.println("=========");

}
}
}

Can anyone see the problem?

Thanks,

Ben

Best answer:

There is a problem with this section:
while(CustomerName[k]!=null)
for( k=4;l<10;k++) <--- what is 'l', k might increase infinitely and make outofbound error
{if(customerName[k]==null) break;
System.out.println("Seat Number : " + k + "Name: " + customerName[i]); } <-- here is your error, 'i' is out of scope
}

By Barcode Scanner 1 comment

Java Sequential Search. What's wrong with my code?

February 27th, 2008 at 07:27pm Under Forum

Java Sequential Search. What’s wrong with my code?
I tested the Sequential Search code by itself and it worked. But when added to the rest of the code cpu usage shoots up to about 60% and nothing else happens. I’ve been stuck on this problem for a while and would appreciate any help.

//Gui-related imports

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

// File-related imports

import java.io.IOException;
import java.util.Scanner;
import java.io.File;
import java.util.Arrays; // to use sort

public class Search extends Frame implements ActionListener
{
// File Parameters
String dataFilePath = null;
String dataFileName = null;

String keysFilePath = null;
String keysFileName = null;

// Array
int[] originalArray = new int[500000];
int[] sortedArray = new int[500000];
int[] hashedArray = new int[1000000];
int[] keysArray = new int[500000];

// Number of data items and keys
int numberOfDataItems = 0;
int numberOfKeys = 0;
int N = 0;

//Statistics
int SSAverageAccessTime = 0;
int keyFound = 0;
int keyNotFound = 0;

String command = “”;

public static void main(String[] args)
{
Frame frame = new Search();
frame.setResizable(false);
frame.setSize(900,500);
frame.setVisible(true);
}
public Search()
{
setTitle(“Search Experiment”);

// Create Menu Bar
MenuBar mb = new MenuBar();
setMenuBar(mb);

//Create Menu Groups Labeled “File” and “Search”
Menu menu = new Menu(“File”);
Menu menu2 = new Menu(“Search”);

// Add it to Menu Bar

mb.add(menu);
mb.add(menu2);

// Create Menu Items
// Add action Listener
// Add to “File” or “Search” Menu Group

MenuItem miOpenData = new MenuItem(“Open Data File”);
MenuItem miOpenKeys = new MenuItem(“Open Key File”);
miOpenData.addActionListener(this);
miOpenKeys.addActionListener(this);
menu.add(miOpenData);
menu.add(miOpenKeys);

MenuItem miSequentialSearch = new MenuItem(“Sequential Search”);
MenuItem miBinarySearch = new MenuItem(“Binary Search”);
miSequentialSearch.addActionListener(this);
miBinarySearch.addActionListener(this);
menu2.add(miSequentialSearch);
menu2.add(miBinarySearch);

MenuItem miExit = new MenuItem(“Exit”);
miExit.addActionListener(this);
menu.add(miExit);
}

public void actionPerformed(ActionEvent ev)
{
// Figure out which command was issued
command = ev.getActionCommand();

// Take action accordingly
if(“Open Data File”.equals(command))
{

dataFilePath = null;
dataFileName = null;

JFileChooser chooser = new JFileChooser();
chooser.setDialogType(JFileChooser.OPEN_DIALOG );
chooser.setDialogTitle(“Open Data File”);

int returnVal = chooser.showOpenDialog(null);
if( returnVal == JFileChooser.APPROVE_OPTION)
{
dataFilePath = chooser.getSelectedFile().getPath();
dataFileName = chooser.getSelectedFile().getName();
}
try
{
numberOfDataItems = ReadFileIntoArray(dataFilePath,”original”);
}
catch(IOException ioe)
{
System.exit(0);
}
// Read keys

// Show dialogue, …
}
else
if(“Open Key File”.equals(command))
{

keysFilePath = null;
keysFileName = null;

JFileChooser chooser1 = new JFileChooser();
chooser1.setDialogType(JFileChooser.OPEN_DIALOG );
chooser1.setDialogTitle(“Open Keys File”);

int returnVal1 = chooser1.showOpenDialog(null);
if( returnVal1 == JFileChooser.APPROVE_OPTION)
{
keysFilePath = chooser1.getSelectedFile().getPath();
keysFileName = chooser1.getSelectedFile().getName();
}
try
{
numberOfKeys = ReadFileIntoArray(keysFilePath, “keys”);
}
catch(IOException ioe)
{
System.exit(0);
}
Initialize(); // Initialize counters
repaint();
}

else
if(“Exit”.equals(command))
{
System.exit(0);
}

if(“Sequential Search”.equals(command))
{
SequentialSearch();

repaint();
}
else
if(“Binary Search”.equals(command))
{
BinarySearch();
repaint();
}
else
if(“Hashed Search”.equals(command))
{
//HashedSearch();
repaint();
}
}

//************************************************
//Called by repaint() to redraw the screen
//************************************************

public void paint(Graphics g)
{
if(“Open Key File”.equals(command))
{
// Acknowledge that file was opened
if (keysFileName != null)
{
g.drawString(“File — “+keysFileName+” — was successfully opened”, 10, 60);

}
else
{
g.drawString(“No key file is open”, 10, 60);

}

return;
}
else
if(“Open Data File”.equals(command))
{
// Acknowledge that file was opened
if (dataFileName != null)

Best answer:

I am a beginner in java programming, and I have a simpler way of doing Java Sequential Search or Java Linear Search, if that is what you want. Here it is:

import java.io.*;
public class linear_search
{
public static void main (String args[]) throws IOException
{
BufferedReader std = new BufferedReader (new InputStreamReader (System.in));
System.out.println (“Input the array elements: “);
int a[] = new int [10];
int i, flag = 0;
for (i = 0; i {
a[i] = Integer.parseInt (std.readLine());
}
System.out.println ("Enter the number to be searched: ");
int ns = Integer.parseInt (std.readLine());
{
for (i = 0; i {
if (ns == a[i])
{
flag = 1;
break;
}
}
if (flag == 1)
{
System.out.println ("Number found! ");
}
else
System.out.println ("Number not found! ");
}
}
}

By Barcode Scanner Add comment

JAVA Trying to .replace the escape character '\' with "\\" for an absolute path.?

February 19th, 2008 at 12:51pm Under Forum

JAVA Trying to .replace the escape character ‘\’ with “\” for an absolute path.?
But it is not working. Here is my code

Scanner textReader = new Scanner(InputFile);
String testx = textReader.nextLine();
System.out.println(testx);
testx = testx.replace(‘\’, (char) (‘\’ + ‘\’));
System.out.println(testx);

I have also tried adding up the ASCII characters in the char typecast but at some point it just gives me the question mark symbol no matter how high I go. I know there is a way to do this I am just not experienced enough.

I am trying to replace something like C:\SDIDOCS\DMADMIN\@q#01!.TIF with C:\SDIDOCS\DMADMIN\@q#01!.TIF for well over 5000 entries in a text file. I refuse to do this manually. Help?

Best answer:

Use 3 \\’s

By Barcode Scanner 1 comment

java programing question?

February 19th, 2008 at 03:16am Under Forum

java programing question?
import java.util.Scanner;
public class AccountManager
{
public static void main(String [] args)
{

// create an array that can store three BankAccount objects

BankAccount [] BankAccount = new BankAccount[3];
String name;
int actNumber;
double balance;

/* write a for loop to create three BankAccount objects and store them in the array
Notice that the constructor of the BankAccount class takes 3 parameters: name,
initial balance, and the account number. You are required to read these
information from the keyboard for each object. */

for(int i = 0; i< BankAccount.length; i++)
{
Scanner scan = new Scanner(System.in);
name = scan.next();
actNumber = scan.nextInt();
balance = scan.nextDouble();
BankAccount[i] = new BankAccount(name, actNumber, balance);
}

// Add 100 dollars to the first account (hint: use deposit method )

BankAcount[0].deposit(100);
// Add 500 dollars to the third account
BankAcount [2].deposit(500);

// deduct 100 dollars from the second account (hint: use withdraw method )
BankAcount [1].withdraw(100);

/*write a for loop to find the account with highest balance and display the account
information.*/
for(int i = 0; i < bankAccount.length; i++)
{
double max = 0.0;
if(max < BankAccount [i])
{
max=BankAccount[i];
}
System.out.println(max);
}

/* find the total savings in the bank (add balances in all three accounts) and
display the total savings*/
for(int i = 0; i < BankAccount [i]; i++)
{
double total;
total = total + BankAccount[i];
}
System.out.println(total);

}
}

// this also has a bank account class to go with it:

import java.text.NumberFormat;

public class BankAccount
{
private String name;
private int actNumber;
private double balance;
private static NumberFormat money = NumberFormat.getCurrencyInstance();

public BankAccount(String userName, int userAccount, double iniBalance)
{
name = userName;
actNumber = userAccount;
balance = iniBalance;
}

public void withdraw(double withdrawAmount)
{
if(withdrawAmount <= balance)
{
balance = balance - withdrawAmount;
}
else
{
System.out.println("Insufficient funds, you only have " + money.format(balance));
}
}

public void deposit(double depositAmount)
{
balance = balance + depositAmount;
}

public double checkBalance()
{
return balance;
}

public String toString()
{
return "Account owner: " + name + "\nAccount number: " + actNumber + "\nAccount balance: " + money.format(balance);
}
}

//the AccountManager is kicking out these errors:
//E:\assignement7\AccountManager.java:33: cannot find symbol
//symbol : variable BankAcount
//location: class AccountManager
//BankAcount[0].deposit(100);
//^
//E:\assignement7\AccountManager.java:35: cannot find symbol
//symbol : variable BankAcount
//location: class AccountManager
//BankAcount [2].deposit(500);
//^
//E:\assignement7\AccountManager.java:38: cannot find symbol
//symbol : variable BankAcount
//location: class AccountManager
//BankAcount [1].withdraw(100);
//^
//E:\assignement7\AccountManager.java:42: cannot find symbol
//symbol : variable bankAccount
//location: class AccountManager
//for(int i = 0; i < bankAccount.length; i++)
// ^
//E:\assignement7\AccountManager.java:45: operator < cannot be applied to double,BankAccount
//if(max < BankAccount [i])
// ^
//E:\assignement7\AccountManager.java:47: incompatible types
//found : BankAccount
//required: double
//max=BankAccount[i];
// ^
//E:\assignement7\AccountManager.java:54: operator < cannot be applied to int,BankAccount
//for(int i = 0; i < BankAccount [i]; i++)
// ^
//E:\assignement7\AccountManager.java:57: operator + cannot be applied to double,BankAccount
//total = total + BankAccount[i];
// ^
//E:\assignement7\AccountManager.java:59: cannot find symbol
//symbol : variable total
//location: class AccountManager
//System.out.println(total);
// ^
//9 errors
//
//Tool completed with exit code 1
//
// any suggestions would be appreciated

Best answer:

u forgot to compile the class BankAccount

By Barcode Scanner 1 comment

Next Posts Previous Posts


Categories