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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:47:29+00:00 2026-06-03T01:47:29+00:00

i am trying to make a object oriented menu, but i encountered some problems

  • 0

i am trying to make a object oriented menu, but i encountered some problems with initialising an int variable with the return of a int function.

Code:

#include <Menu.h>
#include <iostream>
using namespace std;


void Menu::showMainMenu(){
    cout<<"""Main Menu"""<<endl;
    cout<<"1. Manage students"<<endl;
    cout<<"2. Manage assignments"<<endl;
    cout<<"3. Manage statistics"<<endl;
    cout<<"4. Print database"<<endl;
    cout<<"0. Exit"<<endl<<endl;
}


void Menu::showStudentMenu(){
    cout<<"""Student Menu"""<<endl;
    cout<<"1. Add student"<<endl;
    cout<<"2. Remove student"<<endl;
    cout<<"3. Edit student"<<endl;
    cout<<"4. Print student"<<endl;
    cout<<"5. Print students"<<endl<<endl;

}


void Menu::showAssignmentMenu(){
    cout<<"""Assignment Menu"""<<endl;
    cout<<"1. Add assignment"<<endl;
    cout<<"2. Remove assignment"<<endl;
    cout<<"3. Edit assignment"<<endl;
    cout<<"4. Print assignment"<<endl;
    cout<<"5. Print assignments"<<endl<<endl;
}



void Menu::showStatisticsMenu(){
    cout<<"""Assignment Menu"""<<endl;
    cout<<"1. Add assignment"<<endl;
    cout<<"2. Remove assignment"<<endl;
    cout<<"3. Edit assignment"<<endl;
    cout<<"4. Print assignment"<<endl;
    cout<<"5. Print assignments"<<endl<<endl;
}




string Menu::stringInputHandler(){
    string input;
    cout<<"enter:";  cin>>input; cout<<endl;

    if(!input.empty()){
        return input;
    }

    cout<<"Input cannot be empty"<<endl;
    stringInputHandler();
return "Error! (f:sIH)";
}

int intInputHandler(){
    int input;
    cout<<"enter:";  cin>>input; cout<<endl;

    if(input){
        return input;
    }

    cout<<"Input cannot be empty"<<endl;
    intInputHandler();
    return 0;
}


void Menu::CommandControllMain(){
    showMainMenu();
    int ret;
    ret = intInputHandler();

    while(ret){
        switch(ret){
        case 1:CommandControllStudent();break;
        case 2:CommandControllAssignment();break;
        case 3:break;
        case 4:break;
        case 0:break;
        default:cout<<"Wrong option selected!";break;
        }
    } 
}



void Menu::CommandControllStudent(){
    showStudentMenu();
    int ret = intInputHandler();


}



void Menu::CommandControllAssignment(){
    showAssignmentMenu();
    int ret =intInputHandler();

}

void Menu::CommandControllStatistics(){
    showStatisticsMenu();
    int ret =intInputHandler();

}

so there is: intInputHandler() and a var int ret and i cant do int ret = intInputHandler();

ERROR:

D:\c++\Begin\Lab6-8_UML\Debug/../Menu.cpp:121: undefined reference to `Menu::intInputHandler()'
  • 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-03T01:47:30+00:00Added an answer on June 3, 2026 at 1:47 am

    Replace

    int intInputHandler()
    

    with

    int Menu::intInputHandler() 
    

    You’re not implementing the member, but a free function.

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

Sidebar

Related Questions

I'm trying to make getJSON to use JSONP object, but I can't figure out
I'm trying to make this code generic: public final Object unwrap(Class arg0) { throw
I'm trying to make a genric code to serialize and deserialize any object that
I'm trying to learn the code igniter library and object oriented PHP in general
So Im trying to make an object dynamically, please see below code from my
I am trying to make my project completely object oriented and I am separating
So i am trying to learn object oriented programming in javascript. function doStock() {
i'm trying to make a web only using couchdb and couchapp... but for some
I have been trying to write a constructor function that would make an object
I am trying to make a very simple object rotate around a fixed point

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.