What's new

Help User-define header file error c++

Status
Not open for further replies.

IkaMusume

Forum Guru
Elite
Joined
Jan 27, 2018
Posts
1,007
Reaction
15,139
Points
1,900
Age
24
Tanong ko lang po sana kasi kapag tinatype ko ang 1 sa choice dito sa output ko hindi niya tinatawag yung addition()
ps: hidepost ko na po muna, may nakikita kasi akong student dito na ka same school ko na leechers, for safety nadin po and para hindi mareport sa instructor ehe
You do not have permission to view the full content of this post. Log in or register now.
sana po mapansin kung ano remediyong pwede kong gawin para matawag niya yung addition()
 

Attachments

Code:
while (choice <8)
    {
        cout << "Press 1 to 8 only: ";
        cin >> choice;
        if (choice >= 1 && choice < 8)
        {
            break;
        }
        else
        {
            cout << "Invalid Input. ";
        }
    }
    return 0;
}

nandito yta issue mo. kasi yung choice is greater than 1. kya automatic mapunta sa if else break;.to test kung mapunta nga jan. try mo mag lagay ng print code before break or to test yung possible result na gusto mo.
{
cout << "Press 1 to 8 only: ";
cin >> choice;
if (choice >= 1 && choice < 8)
{
cout << "Invalid Input. ";
break;
}
else
{
cout << "Invalid Input. ";
}
}
 
Last edited:
Hindi mo po tinawag yung addition() na method nung inenter ni user ang 1, instead break po ang tinawag mo.
 
Code:
while (choice <8)
    {
        cout << "Press 1 to 8 only: ";
        cin >> choice;
        if (choice >= 1 && choice < 8)
        {
            break;
        }
        else
        {
            cout << "Invalid Input. ";
        }
    }
    return 0;
}

nandito yta issue mo. kasi yung choice is greater than 1. kya automatic mapunta sa if else break;.to test kung mapunta nga jan. try mo mag lagay ng print code before break or to test yung possible result na gusto mo.
{
cout << "Press 1 to 8 only: ";
cin >> choice;
if (choice >= 1 && choice < 8)
{
cout << "Invalid Input. ";
break;
}
else
{
cout << "Invalid Input. ";
}
}
ganito po sana yung expected kong output based sa output ng instructor ko
1653559053061.png
.
tatawagin niya yung case 1 which is yung addition() na nasa arithmetic.h header file.
 

Attachments

ganito po sana yung expected kong output based sa output ng instructor ko
View attachment 1955012.
tatawagin niya yung case 1 which is yung addition() na nasa arithmetic.h header file.
gawin mo nlng method yung choices. pra pwede mo tawagin ulit pag mali yung input.

if (choices == 0 || time < 0){
cout << "Invalid Input. ";
}else if (choices <= 1 || choices <= 8) {
cout << "Input Accepted. ";
} else {
cout << "Invalid Input. ";
}

ito try mo. tested na yan accepted input 1-8. invalid input 0 or negative & greater than 8.
 
Last edited:
Status
Not open for further replies.

Similar threads

Back
Top