Menu

Please help i am begging

2011-12-06
2012-09-26
  • carlton spencer

    carlton spencer - 2011-12-06

    create an application to maintain the student’s records of three (3) students
    registered in two (2) courses in a particular programme.
    a. The application must contain the following CLASSES:
    • Student
    • Programme
    • Course
    • Fee Details
    b. Implement atleast one single and one multiple inheritance in your program
    code.
    c. For each class, identify atleast 4 data members.
    d. Student and Programme class must have member functions to input and print.
    e. Course and Fee details class must contain Mutator and Accessor functions to
    input and print information.
    f. The class Fee details must contain member functions to calculate tuition
    fee, library fee and exam fee. Apply your own formulas for calculation.
    g. The student class must have a method to search and display details for a
    particular student
    h. The fee details class must have a method to search and display details of
    fee paid by a particular student

    In the main program, create the following objects:
    • An object of a programme class
    • 2 objects of course class.
    • 3 objects (use an array) of the Student class.
    • 3 objects of the Fee details class

    Create a menu interface that contains the following options:
    1. Input Programme information
    2. Input Course information
    3. Input student information. (Before inputting information, ask the user to indicate the student for whom the details must be entered)
    4. Input fee information. (Before inputting information, ask the user to indicate the student for whom the details must be entered)
    5. Print programme information
    6. Print Course information
    7. Print Student details and Fee information for each student. (Before printing information, ask the user to indicate the student for whom the details must be printed)
    8. Print complete report (Programme details , Course details and Student details)
    9. Search for a particular student information
    10. Search for fee information for a particular student

    1. Exit

    Perform the appropriate action based on the option selected. Exit the program
    only when zero (0) is entered as the option.

    Points to remember
    • Use constructors and destructors where needed
    • Use proper input and output messages
    • Display the output in a tabular format

     
  • Curtis Sutter

    Curtis Sutter - 2011-12-06

    We are not here to do your homework. However, if you at least try and post
    what you have come up with you may find help then.

     
  • carlton spencer

    carlton spencer - 2011-12-06

    include <iostream>

    include <string>

    include <stdio.h>

    using namespace std;

    int index = 0;

    void welcome_Screen();
    int build_programme();
    void menu();
    string add_Course1();
    string add_Course2();
    string add_Student();
    int add_Feelibrary();
    float add_Feetuition();
    float add_Feelexam();
    //void view_Programs()
    string add_Programs();
    string all_Course(string);

    class Fee_Details{
    protected:
    int library_Fee;
    float tuition_Fee;
    float exam_Fee;

    public:
    Fee_Details(){
    library_Fee = 200;
    tuition_Fee = 200.00;
    exam_Fee = 200.00;
    }
    //Mutator for student name
    void set_Fee_library(int eFee_Name)
    {
    library_Fee = eFee_Name;
    }
    //accessor for student name
    int get_Feelibrary()
    {
    return library_Fee;
    }
    //Mutator for student name
    void set_Fee_Tuition(float eFee_Name)
    {
    tuition_Fee = eFee_Name;
    }
    //accessor for student name
    float get_Fee_Tuition()
    {
    return tuition_Fee;
    }
    //Mutator for student name
    void set_Fee_Exam(float eFee_Name)
    {
    exam_Fee = eFee_Name;
    }
    //accessor for student name
    float get_Fee_Exam()
    {
    return exam_Fee;
    }
    void display_Fee_info()
    {
    cout<<"Your Fee is ";

    }

    };
    class Course:public Fee_Details{

    private:
    string course_Name;
    Fee_Details odj1;

    public:
    //Default Constructor
    Course()
    {
    course_Name = "";
    }
    //Primary Constructor
    Course(string ecourse_Name)
    {
    course_Name = ecourse_Name;
    }

    //Mutator for student name
    void set_Course_Name(string ecourse_Name)
    {
    course_Name = ecourse_Name;
    odj1.set_Fee_library(add_Feelibrary());
    odj1.set_Fee_Tuition(add_Feetuition());
    odj1.set_Fee_Exam(add_Feelexam());

    }
    //accessor for student name
    string get_Course_name()
    {

    return course_Name;
    }
    void display_Course_info()
    {
    cout<<"Your Course is "<<course_Name;

    }

    };
    class programme : public Course{

    private:
    string program_Name;
    Course Obj1;
    Course Obj2;
    public:
    //Default Constructor
    programme()
    {
    program_Name = "";
    }
    //Primary Constructor
    programme(string eprogram_Name)
    {
    program_Name = eprogram_Name;
    //index++;
    }

    //Mutator for student name
    void set_Program_Name(string eprogram_Name)
    {
    program_Name = eprogram_Name;
    Obj1.set_Course_Name(add_Course1());
    Obj2.set_Course_Name(add_Course2());
    //index++;
    }
    string get_programme_Name()
    {
    return program_Name;
    }
    //Accessors for the different courses
    string get_Course_Obj1()
    {
    return Obj1.get_Course_name();
    }
    string get_Course_Obj2()
    {
    return Obj2.get_Course_name();

    }
    //accessor for student name
    void get_programme_names()
    {
    cout<<"\n\t====================== programme MENU =========================\n";
    cout<<"\t| programmeS OFFERED |\n";
    //for(int pos = 0;pos < index;pos++){
    //cout<<"\t|"<<""<< program_Name<< " |\n";
    cout<<"\t|"<<""<< program_Name<< " |\n";
    cout<<"\t|\t"<<"Courses: "<< " |\n";
    cout<<"\t|\t\t"<< Obj1.get_Course_name()<< " |\n";
    cout<<"\t|\t\t"<< Obj2.get_Course_name()<< " |\n";

    cout<<"\t| EXIT SYSTEM |\n";
    cout<<"\t==============================================================\n";
    }
    void display_programme_info()
    {
    cout<<"Your programme is ";//<<program_Name;

    }
    };

    class Student:public programme{

    private:
    string student_name;
    string course1_name;
    string course2_name;
    string programme_name;
    public:
    //Default Constructor
    Student()
    {
    student_name = "";
    course1_name = "";
    course2_name = "";
    programme_name = "";
    }
    //Primary Constructor
    Student(string estudent_name)
    {
    student_name = estudent_name;
    }
    Student(Student &cpy)
    {
    student_name = cpy.student_name;

    }

    ~Student(){

    cout<<"In Student Destructor";
    }
    //Mutator for student name
    void set_student_name(string estudent_name)
    {
    student_name=estudent_name;
    }
    //Mutator for student name
    void set_Student_programme(string eprog_name)
    {
    programme_name = eprog_name;
    }
    //Mutator for student name
    void set_Student_Course1(string ecourse_name1)
    {
    course1_name = ecourse_name1;
    }
    //Mutator for student name
    void set_Student_Course2(string ecourse_name2)
    {
    course2_name = ecourse_name2;
    }
    //accessor for student name

    string get_student_name()const
    {
    return student_name;
    }
    void display_Student_info()
    {

    cout<<"Your student's name is: "<<student_name<<"\n programme Name:
    "<<programme_name<< "\nCourse Name 1: "<<course1_name<<"\nCourse Name 2:
    "<<course2_name;

    }
    };

    void menu(){

    string opt_StuName = "";
    string opt_ProgName = "";
    string opt_CourseName = "";
    int opt_BuildProg;

    programme programme_Obj;
    Course course_Obj1;
    Course course_Obj2;
    Student student_Obj;
    Fee_Details fee_Obj1;
    Fee_Details fee_Obj2;
    Fee_Details fee_Obj3;

    for(int i = 0 ; i < 3 ; )
    {
    system("cls");
    /Welcome Screen of the application/
    welcome_Screen();

    opt_BuildProg = build_programme();

    if (opt_BuildProg == 1)
    {

    programme_Obj.set_Program_Name(add_Programs());
    i++;
    }else if (opt_BuildProg == 2)
    {
    programme_Obj.get_programme_names();

    }else if (opt_BuildProg == 3)
    {
    int p_Name;
    int Opt;

    for (int j = 0; j < 3; j++){
    student_Obj.set_student_name(add_Student());}

    system("cls");
    cout<<"\n\t====================== STUDENTS REGISTERED
    ========================\n";
    cout<<"\t| LIST OF STUDENTS: |\n";
    for (int j = 0; j < 3; j++){

    cout<<"\t|"<<student_Obj.get_student_name()<<"\n";

    }

    programme_Obj.get_programme_names();
    cout<<"Please select the programme for student: ";
    cin>>p_Name;
    if (p_Name == 1)/fix this later as i need an array passed to the programme
    object
    /
    {
    student_Obj_.set_Student_programme(programme_Obj.get_programme_Name());
    programme_Obj.get_programme_names();

    cout<<"Please select the first Course for this Student under this programme:
    ";//put this in a loop for less code
    cin>>Opt;
    if (Opt == 1)
    {
    course_Obj1.set_Course_Name(programme_Obj.get_Course_Obj1());
    student_Obj_.set_Student_Course1(course_Obj1.get_Course_name());
    Opt = 0;

    }else if(Opt == 2)
    {
    course_Obj1.set_Course_Name(programme_Obj.get_Course_Obj2());
    student_Obj_.set_Student_Course1(course_Obj1.get_Course_name());
    Opt = 0;
    }
    else{cout<<"in the else statement";}

    cout<<"Please select the second Course for this Student under this programme:
    ";//put this in a loop for less code
    cin>>Opt;
    if (Opt == 1)
    {
    course_Obj2.set_Course_Name(programme_Obj.get_Course_Obj1());
    student_Obj_.set_Student_Course2(course_Obj2.get_Course_name());
    Opt = 0;

    }else if(Opt == 2)
    {
    course_Obj2.set_Course_Name(programme_Obj.get_Course_Obj2());
    student_Obj_.set_Student_Course2(course_Obj2.get_Course_name());
    Opt = 0;

    }

    student_Obj_.display_Student_info();

    }else if (opt_BuildProg == 4)
    {
    programme_Obj.get_programme_names();

    }else if (opt_BuildProg == 5)
    {
    programme_Obj.get_programme_names();

    }else if (opt_BuildProg == 6)
    {
    programme_Obj.get_programme_names();

    }else if (opt_BuildProg == 7)
    {
    programme_Obj.get_programme_names();

    }
    /*cout<<"Please enter Student Name: ";
    cin>>opt_StuName;
    student_Obj_.set_student_name(opt_StuName);

    system("cls");
    opt_ProgName = add_Programs();
    programme_Obj.set_Program_Name(opt_ProgName);
    student_Obj_.set_Student_programme(programme_Obj.get_programme_names());

    system("cls");
    opt_CourseName = all_Course(opt_ProgName);
    course_Obj1.set_Course_Name(opt_CourseName);
    student_Obj_.set_Student_Course1(course_Obj1.get_Course_name());

    system("cls");
    opt_CourseName = all_Course(opt_ProgName);
    course_Obj2.set_Course_Name(opt_CourseName);
    student_Obj_.set_Student_Course2(course_Obj2.get_Course_name());*/

    getchar();
    }
    for(int i = 0; i < 3; i++){student_Obj_.display_Student_info(); getchar();}

    }

    int build_programme()
    {

    int opt_4Prog = 4;
    for (int i = 0;opt_4Prog != 1 || opt_4Prog != 2 || opt_4Prog != 3 || opt_4Prog
    != 4 || opt_4Prog != 5 || opt_4Prog != 6 || opt_4Prog != 7 ;i++){
    cout<<"\n\t====================== MAIN MENU =========================\n";
    cout<<"\t| SYSTEM OPTIONS: |\n";
    cout<<"\t| : ADD programme AND COURSE DATA |\n";
    cout<<"\t| : VIEW programme AND COURSE DATA |\n";
    cout<<"\t| : REGISTER STUDENT |\n";
    cout<<"\t| : VIEW STUDENT DETAILS AND FEE INFORMATION |\n";
    cout<<"\t| : PRINT COMPLETE REPORT |\n";
    cout<<"\t| : SEARCH STDUENT INFORMATION |\n";
    cout<<"\t| : SEARCH FEE INFORMATION FOR A STUDENT |\n";
    cout<<"\t| EXIT SYSTEM |\n";
    cout<<"\t==============================================================\n";
    cout<<"\n\n\tEnter your choice : ";

    cin>>opt_4Prog;
    getchar();
    if (opt_4Prog == 0)
    {
    exit(1);

    }else if (opt_4Prog == 1)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 2)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 3)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 4)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 5)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 6)
    {
    return opt_4Prog;

    }else if (opt_4Prog == 7)
    {
    return opt_4Prog;

    }else {cout<<"Invalid option entered, please try again";}

    }

    }
    /*string add_Programs()
    {
    int opt_4Prog = 4;

    cout<<"\n\t====================== programme MENU =========================\n";
    cout<<"\t| programmeS OFFERED |\n";
    cout<<"\t| MSc: MASTER OF SCIENCE |\n";
    cout<<"\t| BSc: BACHELOR OF SCIENCE |\n";
    cout<<"\t| PhD: DOCTOR OF PHILOSOPHY |\n";
    cout<<"\t| EXIT SYSTEM |\n";
    cout<<"\t==============================================================\n";
    cout<<"\n\n\tEnter your choice : ";
    cin>>opt_4Prog;

    if (opt_4Prog == 0)
    {
    exit(1);

    }

    if (opt_4Prog == 1)
    {

    return "MSc";

    }else if (opt_4Prog == 2)
    {

    return "BSc";
    }else if ( == 3)
    {

    return "PhD";
    }

    }*/
    string add_Programs()
    {

    string programme_List;
    cout<<"\nPlease Enter the Name of the programme in the System: ";
    cin>>programme_List;
    getchar();
    return programme_List;
    }
    string add_Course1(){

    string course_name;
    cout<<"\nPlease Enter the Name of the 1st Course under this programme in the
    System: ";
    cin>>course_name;
    getchar();
    return course_name;
    }

    string add_Course2(){

    string course_name;
    cout<<"\nPlease Enter the Name of the 2nd Course under this programme in the
    System: ";
    cin>>course_name;
    getchar();
    return course_name;
    }

    int add_Feelibrary()
    {
    int fee_Amt;
    cout<<"\nPlease Enter the Fee Amount of of this Course in the System: ";
    cin>>fee_Amt;
    getchar();
    return fee_Amt;
    }
    float add_Feetuition()
    {
    float fee_Amt;
    cout<<"\nPlease Enter the Fee Amount of Tuition for this Course in the System:
    ";
    cin>>fee_Amt;
    getchar();
    return fee_Amt;
    }
    float add_Feelexam()
    {
    float fee_Amt;
    cout<<"\nPlease Enter the Fee Amount of Exam for this Course in the System: ";
    cin>>fee_Amt;
    getchar();
    return fee_Amt;
    }
    int K = 1;
    string add_Student()
    {

    string name;
    cout<<"Please enter Student"<<K <<"="" Name:="" ";<br="">cin>>name;
    K++;
    return name;
    }
    string all_Course(string opt)
    {
    int opt_4Course = 8;
    string result = "";
    string msc = "MSc";
    string bsc = "BSc";
    string phd = "PhD";

    if (opt == msc){
    cout<<"\n\t====================== MASTER OF SCIENCE
    =========================\n";
    cout<<"\t| COURSES OFFERED ";
    cout<<"\n\t| MATH: MATHEMATICS";
    cout<<"\n\t| ENG : ENGLISH LANGUAGE";
    cout<<"\n\t| HIST: HISTORY";
    cout<<"\n\t| GEO : GEOGRAPHY";
    cout<<"\n\t| BIO : BIOLOGY";
    cout<<"\n\t| CHEM: CHEMISTRY";
    cout<<"\n\t| EXIT SYSTEM";
    cout<<"\n\t===================================================================
    =\n";
    cout<<"\n\n\tEnter your choice : ";
    cin>>opt_4Course;

    }else if(opt == bsc){
    cout<<"\n\t====================== BACHELOR OF SCIENCE
    =========================\n";
    cout<<"\t| COURSES OFFERED ";
    cout<<"\n\t| MATH: MATHEMATICS";
    cout<<"\n\t| ENG : ENGLISH LANGUAGE";
    cout<<"\n\t| HIST: HISTORY";
    cout<<"\n\t| GEO : GEOGRAPHY";
    cout<<"\n\t| BIO : BIOLOGY";
    cout<<"\n\t| CHEM: CHEMISTRY";
    cout<<"\n\t| EXIT SYSTEM";
    cout<<"\n\t===================================================================
    =\n";
    cout<<"\n\n\tEnter your choice : ";
    cin>>opt_4Course;
    }else if(opt == phd){
    cout<<"\n\t====================== DOCTOR OF PHILOSOPHY
    ========================\n";
    cout<<"\t| COURSES OFFERED ";
    cout<<"\n\t| MATH: MATHEMATICS";
    cout<<"\n\t| ENG : ENGLISH LANGUAGE";
    cout<<"\n\t| HIST: HISTORY";
    cout<<"\n\t| GEO : GEOGRAPHY";
    cout<<"\n\t| BIO : BIOLOGY";
    cout<<"\n\t| CHEM: CHEMISTRY";
    cout<<"\n\t| EXIT SYSTEM";
    cout<<"\n\t===================================================================
    =\n";
    cout<<"\n\n\tEnter your choice : ";
    cin>>opt_4Course;
    }

    if (opt_4Course == 0)
    {
    exit(1);

    }

    if (opt_4Course == 1)
    {

    result = "MATHEMATICS";
    return result;

    }else if (opt_4Course == 2)
    {

    result = "ENGLISH LANGUAGE";
    return result;
    }else if (opt_4Course == 3)
    {

    result = "HISTORY";
    return result;
    }else if (opt_4Course == 4)
    {

    result = "GEOGRAPHY";
    return result;
    }else if (opt_4Course == 5)
    {

    result = "BIOLOGY";
    return result;
    }else if (opt_4Course == 6)
    {

    result = "CHEMISTRY";
    return result;
    }

    return result;
    }
    void welcome_Screen()
    {
    //string opt_StuName = "";

    cout<<endl;
    cout<<"\n\n\t\t\t WELCOME TO ";
    cout<<endl;
    cout<<"\n\n\t\t\t STUDENT RECORDS APPLICATION";
    cout<<"\n\n\t\t\t DEVELOPERS :\n";
    cout<<"\n\t\t\t # _ ID# #";
    cout<<"\n\t\t\t #
    _ ID# #";
    cout<<"\n\t\t\t # _ ID# #";
    cout<<"\n\t\t\t #
    _ ID# #";
    cout<<"\n\n\n Press Enter key to continue...... ";
    //cout<<"\n\n\n\Enter 0 to exit Program ";
    cout<<endl<<endl<<endl;

    getchar();
    //cout<<"\n\n\n\Enter new Stduent name to be registered : ";

    //cin>>opt_StuName;
    //if (opt_StuName == "0")
    //{
    //exit(1);

    //}
    //return opt_StuName;

    }
    int main()
    {
    programme det;
    det.display_programme_info();
    menu();

    getchar();
    return 0;
    }


     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.