#include<iostream.h>
#include<conio.h>


int lg, a;
void gi()
{
    cout<< "Enter Lowest Grade:";
    cin>>lg;
    cout<< "Enter Average:";
    cin>>a;
    clrscr();
}

void display()
{

    cout<< "Lowest Grade:"<<lg<<"\n";
    cout<< "Average Grade:"<<a<<"\n";
}
void eval()
{  char ch;
    if(lg>=85 && a>=92)
    cout<<"Remarks: Full SCHOLAR";
    if(lg>=85 && a>=90 && a<=91.99)
    cout<<"Remarks: Half SCHOLAR";
    if(lg>=80 && a>=85 && a<=89)
    cout<<"Remarks: Dean's Lister";
    else
    cout<<"Remarks: DISQUALIFIED";
    cout<<"\nWant another transaction?[y/n]:";
    cin>>ch;
//I want this part to return to my User defined function..gi();
}


void main()
{

    gi();
    display();
    eval();
}

i do not know how to return to gi();....any suggestions senpai?

If you type in "gi" it will go to gi, if you type "q" will exit the program, and if you type something else will go to the display and the eval functions.

int main(){
    string ans;
    for(;;){
        cout<<"> ";
        cin>>ans;
        if (ans=="gi")
            gi();
        else if (ans=="q")
            return(0);
        else{
            display();
            eval();
        }
    return (0);
}

Edited 4 Years Ago by Lucaci Andrew

[Off-topic, copy-pasted post deleted]

Edited 4 Years Ago by Ezzaral: Do ensure you own the intellectual property rights to everything that you post.Do not post copyright-infringing material.

Branickiod: I think you are confused. This is the C++ foru, not the SQL Server forum, and the text you quoted isn't relevant to the matter at hand in any way, shape or form. I know you meant well, but please pay more attention to where you are posting in the future.

This article has been dead for over six months. Start a new discussion instead.