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 7749485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:03:43+00:00 2026-06-01T11:03:43+00:00

For a homework assignment, I’m working with the following. It’s an assigned class structure,

  • 0

For a homework assignment, I’m working with the following. It’s an assigned class structure, I know it’s not the best design by a long shot.

Class           | Extends         | Variables
--------------------------------------------------------
Person          | None            | firstName, lastName, streetAddress, zipCode, phone
CollegeEmployee | Person          | ssn, salary,deptName
Faculty         | CollegeEmployee | tenure(boolean)
Student         | person          | GPA,major

So in the Faculty class…

 public class Faculty extends CollegeEmployee
 {
      protected String booleanFlag;
      protected boolean tenured;
      public Faculty(String firstName, String lastName, String streetAddress,
                     String zipCode, String phoneNumber,String ssn,
                     String department,double salary)
      { 
           super(firstName,lastName,streetAddress,zipCode,phoneNumber,
                 ssn,department,salary);
           String booleanFlag = JOptionPane.showInputDialog
                                (null, "Tenured (Y/N)?");
           if(booleanFlag.equals("Y"))
           tenured = true;
           else
           tenured = false;
       }
 }

It was my understanding that super() in Faculty would allow access to the variables in CollegeEmployee as well as Person. With the code above, it compiles fine when I ONLY include the Person variables. As soon as I try to use ssn, department, or salary I get the following compile errors.

 Faculty.java:15: error: constructor CollegeEmployee in class CollegeEmployee can not be applied to the given types:
            super(firstName,lastName,streetAddress,zipCode,phoneNumber,ssn,department,salary);
                                                                                            ^
Required: String,String,String,String,String
   Found: String,String,String,String,String,String,String,String
  reason: actual and formal argument lists differ in length

I’m completely confused by this error…which is the actual and formal? Person has five arguments, CollegeEmployee has 3, so my guess is that something’s funky with how the parameters are being passed…but I’m not quite sure where to begin fixing it. What am I missing?

Here’s my CollegeEmployee class

 import java.util.*;
 import javax.swing.*;
 //
 public class CollegeEmployee extends Person
 {
     protected String ssn;
     protected String sal;
     protected double annSalary;
     protected String department;
 //
     public CollegeEmployee(String firstName, String lastName, 
                            String streetAddress, String zipCode, 
                            String phoneNumber)
     {
          super(firstName,lastName,streetAddress,zipCode,phoneNumber);
          ssn = JOptionPane.showInputDialog(null, "Enter SSN ");
          department = JOptionPane.showInputDialog
                       (null, "Enter department: ");
          sal = JOptionPane.showInputDialog(null, "Enter salary: ");
         annSalary = Double.parseDouble(sal);
     }
 //
     public void setSSN(String ssn)
     {         this.ssn = ssn;         }
     public void setAnnSalary(double annSalary)
     {        this.annSalary = annSalary;     }
     public void setDepartment(String department)
     {        this.department = department;    }
 //
     public String getSSN()
     {        return ssn;                }
     public double getAnnSalary()
     {        return annSalary;          }
     public String getDepartment()
     {        return department;         }
 //
     public void display()
     {
         super.display();
         JOptionPane.showMessageDialog
         (null, "\nSSN: " + getSSN() + "\nAnnual Salary: " 
          + getAnnSalary() + "\nDepartment: " + getDepartment(), 
          "Information", JOptionPane.QUESTION_MESSAGE);
     }
 }
  • 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-06-01T11:03:44+00:00Added an answer on June 1, 2026 at 11:03 am

    You made an accidental ; at the end of your constructor:

          public Faculty(String firstName, String lastName, String streetAddress,   String zipCode, String phoneNumber,String ssn,
               String Department,double salary); // <--- this has to go
    

    And as pointed out in a comment you have String Department in your constructor, but you pass department (incorrect capitalization), rename your constructor argument to String department

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

Sidebar

Related Questions

I am working on a homework assignment for a class. The problem statement says
For a homework assignment I was given a Card class that has enumerated types
I'm working on a homework assignment and I ran into a little snag. I'm
I am working on a homework assignment and I'm trying to figure out a
I'm working on a homework assignment to modify code given by my professor using
A homework assignment requires me to make a bag data structure in Java by
My homework assignment is telling me to declare a class inline, but I've only
I have a homework assignment. I'm not looking for anyone to do the work
I've got a homework assignment where I have a base class Package, and two
This is in relation to a homework assignment but this is not the homework

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.