❔ Why does it say unrecognized escape sequence?

I'm coding another assignment that we have to do. We have to make a program that will calculate the average of four grades inputed by the user. I want it to display "Average:" and then the result of the thing at the end, but it says unrecognized escape sequence. What am I missing here?
66 Replies
vdvman1
vdvman12y ago
You have \C on line 17
QuiteZestyy
QuiteZestyyOP2y ago
OH ... I also have another question actually, so I did the first half of our task which was this. But we have another part of it where we have to make it display a message That's the part I'm stuck on It's just if else stuff right?
QuiteZestyy
QuiteZestyyOP2y ago
TheRanger
TheRanger2y ago
yeah but its cleaner to use switch statements
QuiteZestyy
QuiteZestyyOP2y ago
What are those? They havent taught us those yet
TheRanger
TheRanger2y ago
well then use if else
QuiteZestyy
QuiteZestyyOP2y ago
Am I on the right track with this?
QuiteZestyy
QuiteZestyyOP2y ago
It doesnt display the messages when I run it though
TheRanger
TheRanger2y ago
what messages?
QuiteZestyy
QuiteZestyyOP2y ago
I have to make it display a message at the end based on the average. I cant get it to do that Idk if im missing smth on the code or what
TheRanger
TheRanger2y ago
what last message did it display?
QuiteZestyy
QuiteZestyyOP2y ago
Nothing
TheRanger
TheRanger2y ago
doesnt even print English Grade ?
QuiteZestyy
QuiteZestyyOP2y ago
It didnt display anything of what i coded here Those it did
TheRanger
TheRanger2y ago
confusing so what last message did it display Computer Grade?
QuiteZestyy
QuiteZestyyOP2y ago
Lemme show it wait
TheRanger
TheRanger2y ago
or Average ?
QuiteZestyy
QuiteZestyyOP2y ago
QuiteZestyy
QuiteZestyyOP2y ago
Its supposed to input the values of the numbers on those empty spots. But dw the app doesnt support that But if u run it on pc itll show
TheRanger
TheRanger2y ago
well it makes sense u didnt handle for result 90
QuiteZestyy
QuiteZestyyOP2y ago
Oh Uh how do i do that
TheRanger
TheRanger2y ago
same way u did for 98 and 100
QuiteZestyy
QuiteZestyyOP2y ago
OHH ok wait lemme see But theres another thing that confuses me Some stuff here says 95 to 97.99 etc and i dont think a simple >= will cover those, so what do I do
TheRanger
TheRanger2y ago
yes it can
QuiteZestyy
QuiteZestyyOP2y ago
Oh
TheRanger
TheRanger2y ago
just put another else if
QuiteZestyy
QuiteZestyyOP2y ago
So I just do >= the rest of the way?
TheRanger
TheRanger2y ago
yes, same as u did for 98
QuiteZestyy
QuiteZestyyOP2y ago
Yeah but our instructor said something about decimals and i dont get it
TheRanger
TheRanger2y ago
something like what?
QuiteZestyy
QuiteZestyyOP2y ago
Nvm i guess shes just baiting us to make mistakes
TheRanger
TheRanger2y ago
lets not assume that
QuiteZestyy
QuiteZestyyOP2y ago
Ok but Lets assume I wanna put like If the result is 95 to 97.99, how do i input that
TheRanger
TheRanger2y ago
else if (result >= 95 && result <= 97.99)
QuiteZestyy
QuiteZestyyOP2y ago
This is working as intended so far tho
TheRanger
TheRanger2y ago
but unneeded in your case
QuiteZestyy
QuiteZestyyOP2y ago
Oh ok What is the && for again?
TheRanger
TheRanger2y ago
because the 3rd if condition would get checked if the result isnt 98 or above anyway && is for and
QuiteZestyy
QuiteZestyyOP2y ago
Huh, i see Sorry for the questions btw thanks for bearing with me I'll finish this then send how it looks if theres anything that can be improved etc Wait nvm
QuiteZestyy
QuiteZestyyOP2y ago
Uhh @TheRanger
TheRanger
TheRanger2y ago
in line 43 u forgot to put if after else but you dont really need to check if result is less than 75 just put else because the student would fail anyway if non of the if conditions were satisfied
QuiteZestyy
QuiteZestyyOP2y ago
Ok wait
QuiteZestyy
QuiteZestyyOP2y ago
QuiteZestyy
QuiteZestyyOP2y ago
Now what..
TheRanger
TheRanger2y ago
show ur new code
QuiteZestyy
QuiteZestyyOP2y ago
TheRanger
TheRanger2y ago
remove (result < 75); from line 43
QuiteZestyy
QuiteZestyyOP2y ago
What do I put there
TheRanger
TheRanger2y ago
just remove that and run ur code
QuiteZestyy
QuiteZestyyOP2y ago
Still same error
TheRanger
TheRanger2y ago
also remove the ; at every line of else if
QuiteZestyy
QuiteZestyyOP2y ago
Oh hm Ok so AYY IT WORKS
QuiteZestyy
QuiteZestyyOP2y ago
QuiteZestyy
QuiteZestyyOP2y ago
zestyheart it be possible to put like an extra line of space in between the grades and the average
TheRanger
TheRanger2y ago
where is that?
QuiteZestyy
QuiteZestyyOP2y ago
QuiteZestyy
QuiteZestyyOP2y ago
I just wanna add space between them
TheRanger
TheRanger2y ago
like Computer Grade: Average: 87.25 ?
QuiteZestyy
QuiteZestyyOP2y ago
Ye like Computer grade: Average: Just space Between em
TheRanger
TheRanger2y ago
just put a Console.WriteLine() between them
QuiteZestyy
QuiteZestyyOP2y ago
I thought writeline does that Oh
TheRanger
TheRanger2y ago
or u can put \n at the end of Computer Grade or beginning of Average strings
QuiteZestyy
QuiteZestyyOP2y ago
oh mannn
QuiteZestyy
QuiteZestyyOP2y ago
QuiteZestyy
QuiteZestyyOP2y ago
This works! Thanks zestyheart think i will get the hang of this sooner or later I appreciate the help man
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server