+ 1
Please let me know why it's only taking first line to print I want all sentencs to print based on typing speed, please
12 Respostas
+ 5
Read the error message, look at the line that the error message shows.
else does not take any condition.
Also check your other conditions, for example:
if(wpm>=1 && wpm>10)
If wpm is > 10, it will always be >= 1. What you probably mean is
if(wpm>=1 && wpm<10)
+ 4
Again: "else" does not take any condition.
if (wpm >= 1 && wmp < 10)
...
else if (wmp >= 10 && wmp < 20)
...
...
else
this is the rest
Have a close look at the difference between || and && and the >= and < operators.
+ 3
Great, it works now :)
+ 2
Looks good! Just one more thing: Consider your input is exactly 20 â in that case there is no output.
Similar issue for other numbers.
+ 2
Enter 20.
What output do you get?
+ 1
Because you use if ... else if that execute only the first block where the condition match.
At example if wpm is more than 100 all the conditions are matched but only the first is executed (because of else if statements).
You can solve by uaing only if without else
0
Lisa, if I enter 12 it should print 2nd line and if I enter 100 then should last line so?
0
Ok
0
Thanks a lot đčđ†LISA now it's working
0
I checked for all it's printing desired sentences whatever I want thank you â€
0
cout<<"Equivalent to one word every 3 seconds Focus on your technique andkeep practicing.
0
Ok