Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7538043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:00:45+00:00 2026-05-30T07:00:45+00:00

I need to preface this with I am not allowed to use an IDE

  • 0

I need to preface this with I am not allowed to use an IDE in class, I must use TextPad to compile and run. Any help would be greatly appreciated.

There are two files at play here, one called Account and the other called Lab4B. The assignment is to create and use the following files:
Lab4B.java = source code for the driver code class (Lab4B) for the assignments
Account.java = source code for the Account class

The instructions are:
Design a class named Account (that contains

  1. A private int data field named id for the account (default 0).
  2. A private double data field named balance for the account (default 0).
  3. A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate.
  4. A private Date data field named dateCreated that stores the date when the account was created.
  5. A no-arg constructor that creates a default account.
  6. A constructor that creates an account with the specified id and initial balance.
  7. The accessor and mutator methods for id, balance, and annualInterestRate.
  8. The accessor method for dateCreated.
  9. A method named getMonthlyInterestRate() that returns the monthly interest rate.
  10. A method named withdraw that withdraws a specified amount from the account.
  11. A method named deposit that deposits a specified amount from the account.

I am getting the following errors:
The errors are when I compile the “Lab4B” file.

F:\Java\Lab 4b\Lab4B.java:13: error: cannot find symbol
   Account account = new Account(5544, 45000, 0.036);
   ^
  symbol:   class Account
  location: class Lab4B

F:\Java\Lab 4b\Lab4B.java:13: error: cannot find symbol
   Account account = new Account(5544, 45000, 0.036);
                         ^
  symbol:   class Account
  location: class Lab4B
2 errors

The code for “Account” is below:

import java.util.Scanner;
import java.util.Date;

public class Account
{

    int id = 0;
    double balance = 0;
    double annualInterestRate = 0;
    Date dateCreated;


    public Account()
    {

    }

    public Account(int id, double balance, double annualInterestRate)
    {

    this.id = id;
    this.balance = balance;
    this.annualInterestRate = annualInterestRate;
    this.dateCreated = new Date();
    }

    public void setID (int id)
    {
    this.id = id;
    }


    public int getID()
    {
    return this.id;
    }


    public void setBalance (double balance)
    {
    this.balance = balance;
    }


    public double getbalance()
    {
    return this.balance;
    }


    public void setAnnualInterestrate (double annualInterestRate)
    {
    this.annualInterestRate = annualInterestRate;
    }


    public double getAnnualInterestrate()
    {
    return this.annualInterestRate;
    }


    public Date getDateCreated()
    {
    return this.dateCreated;
    }


    public double getMonthlyInterestRate()
    {
    return (this.annualInterestRate) / 12;
    }


    public void withdraw(double amount)
    {
    this.balance -= amount;
    System.out.println ("After withdrawing $"+amount +" the balance in your account is:                                                  $   " +this.balance +"\n");
    }


public void deposit(double amount)
{
    this.balance += amount;
    System.out.println(" After making a deposit of $"+amount +" the balance in your    account is: $"  +this.balance + "\n");
}
 }

The code for the Lab4B file is below:

public class Lab4B
{

public static void main(String[] args)
{

   // Creates an instance of Account

   Account account = new Account(5544, 45000, 0.036);

   // Sets default amounts

   account.setID(5544);
   account.setBalance(45000);
   account.setAnnualInterestRate(0.036);
   account.withdraw(3700);
   account.deposit(2200);

   // Prints output

   System.out.println ("Account number: \n"+ +account.getID());
   System.out.println ("The account balance is: $ \n" + +account.getbalance());
   System.out.println ("The monthly interest earned is: $ \n" + +account.getbalance() *    account.annualInterestRate());
   System.out.println ("The account was created on: \n" + +account.getdateCreated());
 }
}

Here are the errors I am getting from the javac command line compiler as suggested:

C:\>javac Lab4B.java
Lab4B.java:5: error: package mypackage does not exist
import mypackage.Account;
                ^
Lab4B.java:15: error: cannot find symbol
   Account account = new Account(5544, 45000, 0.036);
   ^
   symbol:   class Account
   location: class Lab4B
Lab4B.java:15: error: cannot find symbol
   Account account = new Account(5544, 45000, 0.036);
                         ^
  symbol:   class Account
  location: class Lab4B
3 errors

Here is the javac -verbose output:

C:\Users\kschultz>cd\

C:\>javac -verbose Lab4B.java
[parsing started RegularFileObject[Lab4B.java]]
[parsing completed 12ms]
[search path for source files: .C:\Program Files (x86)\Java\jdk1.7.0_02\lib,C:\P
rogram Files (x86)\Java\jre6\lib\ext\QTJava.zip]
[search path for class files: C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\re
sources.jar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\rt.jar,C:\Program Fi
les (x86)\Java\jdk1.7.0_02\jre\lib\sunrsasign.jar,C:\Program Files (x86)\Java\jd
k1.7.0_02\jre\lib\jsse.jar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\jce.j
ar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\charsets.jar,C:\Program Files
 (x86)\Java\jdk1.7.0_02\jre\classes,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\
 lib\ext\dnsns.jar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\ext\localedata
 .jar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\ext\sunec.jar,C:\Program Fi
 les (x86)\Java\jdk1.7.0_02\jre\lib\ext\sunjce_provider.jar,C:\Program Files (x86
 )\Java\jdk1.7.0_02\jre\lib\ext\sunmscapi.jar,C:\Program Files (x86)\Java\jdk1.7.
 0_02\jre\lib\ext\sunpkcs11.jar,C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib\e
 xt\zipfs.jar,.C:\Program Files (x86)\Java\jdk1.7.0_02\lib,C:\Program Files (x86)
\Java\jre6\lib\ext\QTJava.zip]
[loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
ym(META-INF/sym/rt.jar/java/lang/Object.class)]]
[loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
ym(META-INF/sym/rt.jar/java/lang/String.class)]]
[checking Lab4B]
[loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
ym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]
Lab4B.java:13: error: cannot find symbol
    Account account = new Account(5544, 45000, 0.036);
    ^
  symbol:   class Account
  location: class Lab4B
 Lab4B.java:13: error: cannot find symbol
    Account account = new Account(5544, 45000, 0.036);
                          ^
  symbol:   class Account
  location: class Lab4B
 [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
 ym(META-INF/sym/rt.jar/java/lang/System.class)]]
 [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
 ym(META-INF/sym/rt.jar/java/io/PrintStream.class)]]
[loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
ym(META-INF/sym/rt.jar/java/io/FilterOutputStream.class)]]
[loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0_02\lib\ct.s
ym(META-INF/sym/rt.jar/java/io/OutputStream.class)]]
[total 228ms]
2 errors
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:00:47+00:00Added an answer on May 30, 2026 at 7:00 am

    Both of your errors are related to the same problem.

    Lab4B.java:5: error: package mypackage does not exist
    Lab4B.java:15: error: cannot find symbol
    

    Problem:

    • Your Account class doesn’t contain package declaration. (check if Account class is really inside a “mypackage” directory)
    • Your Lab4B class doesn’t contain a package import.

    Solution:

    Package declaration syntax

    package mypackage;
    import java.util.Scanner;
    import java.util.Date;
    public class Account {
       //rest of the code
    

    The statement order is as follows.

    1. Package statment (optional).
    2. Imports (optional).
    3. Class or interface definitions.

    Package Import syntax

    import mypackage.Account;
    public class Lab4B
    {
       //rest of code
    

    There are 3 ways you can specify package imports.

    The JOptionPane class is in the swing package, which is located in the javax package. The wildcard character (*) is used to specify that all classes with that package are available to your program. This is the most common programming style.

    import javax.swing.*;  // Make all classes visible altho only one is used.
    
    class ImportTest {
        public static void main(String[] args) {
            JOptionPane.showMessageDialog(null, "Hi");
            System.exit(0);
        }
    }
    

    Classes can be specified explicitly on import instead of using the wildcard character.

    import javax.swing.JOptionPane;  // Make a single class visible.
    
    class ImportTest {
        public static void main(String[] args) {
            JOptionPane.showMessageDialog(null, "Hi");
            System.exit(0);
        }
    }
    

    Alternately we can the fully qualified class name without an import.

    class ImportTest {
        public static void main(String[] args) {
            javax.swing.JOptionPane.showMessageDialog(null, "Hi");
            System.exit(0);
        }
    }
    

    You can read more about packages here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to preface this with I am not allowed to use an IDE
I need to preface this with we are not allowed to use IDE's in
I need to preface this with I am not allowed to use an IDE
I need to preface this with I am not allowed to use an IDE
I need to preface this with my instructor doesn't let us use IDE's. We
Preface: I'm not sure what resources are. I need this form (which is working
Let me preface this by saying this is not an actual situation of mine
I'd like to preface this by stating that this is for a class, so
Preface: This has become a quite a long post. While I'm not new to
To preface this, I'm not familiar with OLAP at all, so if the terminology

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.