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

  • Home
  • SEARCH
  • 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 6804261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:26:39+00:00 2026-05-26T19:26:39+00:00

I am working on a problem for homework in a Java Programming course, and

  • 0

I am working on a problem for homework in a Java Programming course, and I am stuck. I will tell you upfront that I am by no means an expert, and don’t know much about Java or Programming in general.

The issue that I am having is acutally not with a problem for my homework, but with an example from the book that I cannot seem to get to work. The section of the book is titled

WRITING AN APPLICATION THAT USES THE Event CLASS

The book has the following example in this section that it instructs the student to copy and try in their IDE to see how the concept of an Event class works:

import java.util.Scanner;

public class CreateEventObject
{

    public static void main(String[] args)
    {

    int eventType;
    String chosenManager = "";
    double chosenRate = 0;
    Event scheduledEvent = new Event();
    final int PRIVATE_CODE = 1;
    final int CORPORATE_CODE = 2;
    final int NONPROFIT_CODE = 3;
    final String PRIVATE_MANAGER = "Dustin Britt";
    final String CORP_MANAGER = "Carmen Lindsey";
    final String NONPROFIT_MANAGER = "Robin Armenetti";
    final double PRIVATE_RATE = 47.99;
    final double CORP_RATE = 75.99;
    final double NONPROFIT_RATE = 40.99;
    boolean choiceIsGood = true;

    Scanner input = new Scanner(System.in);
    System.out.println("What type of event are you scheduling?");
    System.out.print("Enter " + PRIVATE_CODE + " for private, " + CORPORATE_CODE + " for corporate, or " + NONPROFIT_CODE + " for nonprofit... ");
    eventType = input.nextInt();

    if(eventType == PRIVATE_CODE)
    {
        chosenManager = PRIVATE_MANAGER;
        chosenRate = PRIVATE_RATE;
    }
    else
        if(eventType == CORPORATE_CODE)
        {
            chosenManager = CORP_MANAGER;
            chosenRate = CORP_RATE;
        }
        else
            if(eventType == NONPROFIT_CODE)
            {
                chosenManager = NONPROFIT_MANAGER;
                chosenRate = NONPROFIT_RATE;
            }
            else
                choiceIsGood = false;

    if(choiceIsGood)
    {
        scheduledEvent.setType(eventType);
        scheduledEvent.setManager(chosenManager);
        scheduledEvent.setRate(chosenRate);
    }
    else
        System.out.println("You entered " + eventType + " which is invalid.");

    System.out.println("Scheduled event:");
    System.out.println("Type: " + scheduledEvent.getType() + " Manager: " + scheduledEvent.getManager() + " Rate: " + scheduledEvent.getRate() + " per hour");
    }

}

When I try to compile the code above, I get the following error from the IDE:

CreateEventObject.java:12: error: cannot find symbol
    Event scheduledEvent = new Event();
    ^
  symbol:   class Event
  location: class CreateEventObject
CreateEventObject.java:12: error: cannot find symbol

It says the class Event is the issue, but according to the book, that’s a valid class…

I am using JGRASP on Windows 7 Professional 64bit and JDK 1.70.

I think it is weird that an example from the book doesn’t compile correctly, but it isn’t. I am probably missing something really easy, but I can’t see anythign that is wrong.

Any help or direction would be appreciated. Thanks in advance for the help.

  • 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-26T19:26:39+00:00Added an answer on May 26, 2026 at 7:26 pm

    You are trying to use those methods:

    scheduledEvent.setType(eventType);
    scheduledEvent.setManager(chosenManager);
    scheduledEvent.setRate(chosenRate);
    

    that don’t belong to awt Event class. So probably in your book there is somewhere described an Event class: find it then:

    1. create a class with the implementation described in your book
    2. Add that class to CreateEventObject’s package or put it inside another package and then import it:

      import your.package.name.Event;
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a problem working with the image classes in java. I am creating
Problem When working with MasterPages, a common irritation I run into is that script
I'm working on a problem that requires caching paginated search results: Paginating very large
I am working on a problem and got stuck at a wall I have
I'm working on a homework assignment that asks me to create a calculator that
I'm concerned that this might be working on an NP-Complete problem. I'm hoping someone
I'm working on a homework assignment that basically asks us to parse a DNS
I'm working on a homework problem out of Stalling's Operating Systems: Internals and Design
I'm working on a homework problem and I'm having some difficulties creating a O(n*logn)
I am working on a homework assignment for a class. The problem statement says

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.