0
My Code is not working i tried everything
#include <iostream> using namespace std; void bot(int mode,string name) { if(mode == 1) { cout << "Welcome," << name << "!" ; } else if(mode==2){ cout << "Goodbye, " << name << "!" ; } else { cout << "Try again"; } } int main() { int mode; cin >> mode; string name; cin >> name; bot(mode,name); }
23 Answers
+ 5
Sisanda Shwala please share the code coach sololution task from the lesson you are attempting.
AS Brian mentioned based upon what you have share the code appears to work.
+ 2
Now I understand that this is a Code Coach task. Code Coach is unforgiving when it comes to spelling, punctuation, capitalization and spaces between words. Be sure your output matches exactly what the task says. My guess is that you need a space after the comma that follows "Welcome,". Also, maybe a period is needed after "Try again".
+ 1
Sisanda Shwala, the code works for me. What problem are you having?
+ 1
I see. Thanks for the help 🙏🙏
+ 1
Sisanda Shwala it is not time to give up yet. Maybe we can discover some oversight. Please follow up and provide the original problem description and your latest code in Sololearn Code Playground. Posting the link to each would be best.
+ 1
Sisanda Shwala Also, if you post your code (this time or in the future if there be any other questions) not as a plain text, but as a "code bit" and add it to your question, it will help a lot in helping you. But, if you do so, don't edit the code in question later, to not confuse the readers after the problem is solved.
0
Sololearn says i have test case 4 and test case 5 issues😭
0
You are welcome. I will be glad to help further if that does not solve the problem.
0
hey Brian. im still failing to do it😭
0
I have been unable to locate this Code Coach task. Would you share a link to the task or paste the title and description here?
If it is inside a tutorial, please indicate which course and lesson number.
0
i guess code coach is just giving me a hard time. can someone login and help😣
0
Sisanda Shwala everyone here wants to help you, but in order to do that we need to see the actual task. So please tell us what is that? Name of the course, lesson number, etc.
0
okay its Function Parameters, writing a program for a chatbot,assigned by Code Coach. it kept saying the test case 4 and 5 were wrong. I'd appreciate it if you could look into it.
0
Sisanda Shwala In the Code Coach section I don't see anything named "Function Parameters" or with the word "chatbot" in the title. Do you mean Code Coach inside some course?
0
yes its in the Introduction to C++ course
0
Which section?
0
Functions in=>Function Parameters
0
It's inaccessible without pro subscription. I guess you need to copy-paste the text of the task here to get help (or type it by hand if it couldn't be copied).
0
please check again. Function Parameters are below the Chatbot
0
Sisanda Shwala I see only the "Chat Bot" practice between the "Functions" and "Function Parameters" lessons. Do you mean there's a code coach also named "Chatbot" at the end of the "Function Parameters" lesson?
Anyway, I haven't completed this course yet, so I have it grayed out and can't read the task.