❔ 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
You have
\C
on line 17OH
...
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?
yeah but its cleaner to use switch statements
What are those?
They havent taught us those yet
well then use if else
Am I on the right track with this?
It doesnt display the messages when I run it though
what messages?
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
what last message did it display?
Nothing
doesnt even print
English Grade
?It didnt display anything of what i coded here
Those it did
confusing
so what last message did it display
Computer Grade?
Lemme show it wait
or
Average
?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
well it makes sense
u didnt handle for result
90
Oh
Uh how do i do that
same way u did for 98 and 100
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
yes it can
Oh
just put another else if
So I just do >= the rest of the way?
yes, same as u did for 98
Yeah but our instructor said something about decimals and i dont get it
something like what?
Nvm i guess shes just baiting us to make mistakes
lets not assume that
Ok but
Lets assume I wanna put like
If the result is 95 to 97.99, how do i input that
else if (result >= 95 && result <= 97.99)
This is working as intended so far tho
but unneeded in your case
Oh ok
What is the && for again?
because the 3rd if condition would get checked if the result isnt 98 or above anyway
&& is for
and
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
Uhh @TheRanger
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 satisfiedOk wait
Now what..
show ur new code
remove
(result < 75);
from line 43What do I put there
just remove that
and run ur code
Still same error
also
remove the
;
at every line of else if
Oh
hm
Ok so
AYY IT WORKS
it be possible to put like an extra line of space in between the grades and the average
where is that?
I just wanna add space between them
like
Computer Grade: Average: 87.25
?Ye like
Computer grade:
Average:
Just space
Between em
just put a
Console.WriteLine()
between themI thought writeline does that
Oh
or u can put
\n
at the end of Computer Grade
or beginning of Average
stringsoh mannn
This works! Thanks think i will get the hang of this sooner or later
I appreciate the help man
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.