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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:54:36+00:00 2026-06-01T16:54:36+00:00

When I inherit the base class, it’s telling me there is no such class

  • 0

When I inherit the base class, it’s telling me there is no such class

This is enhanced.h:

  class enhanced: public changeDispenser // <--------where error is occuring
    {
    public:
        void changeStatus();
        // Function: Lets the user know how much of each coin is in the machine
        enhanced(int);
        // Constructor
        // Sets the Dollar amount to what the User wants
        void changeLoad(int);
        // Function: Loads what change the user requests into the Coin Machine
        int dispenseChange(int);
        // Function: Takes the users amount of cents requests and dispenses it to the user

    private:
        int dollar;
    };

This is enhanced.cpp:

#include "enhanced.h"
#include <iostream>
using namespace std;
enhanced::enhanced(int dol)
{
    dollar = dol;
}

void enhanced::changeStatus()
{
    cout << dollar << " dollars, ";
    changeDispenser::changeStatus();
}

void enhanced::changeLoad(int d)
{
    dollar = dollar + d;
    //changeDispenser::changeLoad;
}

This is changeDispenser.h:

class changeDispenser
{
public:
    void changeStatus();
    // Function: Lets the user know how much of each coin is in the machine
    changeDispenser(int, int, int, int);
    // Constructor
    // Sets the Quarters, Dimes, Nickels, and Pennies to what the User wants
    void changeLoad(int, int, int, int);
    // Function: Loads what change the user requests into the Coin Machine
    int dispenseChange(int);
    // Function: Takes the users amount of cents requests and dispenses it to the user
private:
    int quarter;
    int dime;
    int nickel;
    int penny;
};

I didn’t include the driver file or the changeDispenser imp file, but in the driver, these are included

#include "changeDispenser.h"
#include "enhanced.h"
  • 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-01T16:54:37+00:00Added an answer on June 1, 2026 at 4:54 pm

    Firstly, you need to put header of the class changeDispenser in separate header file and include it in derived class header.

    The class changeDispenser doesn’t have default non-argument constructor, so you need to initialize it explicitly in the derived class. Something along the lines:

    enhanced::enhanced(int dol) : changeDispenser(0, 0, 0, 0)
    {
        dollar = dol;
    }
    

    Or you could define default values for the constructor arguments, which is less preferable for stylistic reasons.

    changeDispenser(int i=0, int j=0, int k=0, int l=0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code like this: class Base { public: void operator = (const Base&
There is a Base class and a Derive class. Derive public inherit Base. The
I have usercontrols which inherit a base class which looks like this: BasePage.cs: using
I have a base class which looks something like this: class Base { public:
If I inherit from a base class and want to pass something from the
I have a series of composite user controls that inherit from a base class
I have 2 web user controls, both inherit the same base class which extends
Some background info; LanguageResource is the base class LanguageTranslatorResource and LanguageEditorResource inherit from LanguageResource
I have a class that inherits from a base class (this contains a lot
If I have a base class that implement INotifyPropertyChanged public class ResourceWrapperBase : INotifyPropertyChanged

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.