#Please help, this assignment is due tomorrow

152 messages · Page 1 of 1 (latest)

autumn mossBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@lost niche

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

novel egret
#

Show your code

haughty beacon
#

Hey so you should ignore the value that scanf() reutrns

#

you are making an if statement with the scanf() inside the if statement

haughty beacon
#

what you should do instead is put the scanf out of it and evaluate the variable that you just read

haughty beacon
rigid nebula
haughty beacon
#

it returns the number of characters?

lost niche
#

removed the "if" before the scanf and it made it worse

haughty beacon
#

You should not remove the if

rigid nebula
haughty beacon
#

you should take the scanf out of the if inside of it

rigid nebula
haughty beacon
lost niche
#

everything else is correct but it keeps saying this

haughty beacon
#

not the reutnr value of the scanf function

haughty beacon
rigid nebula
haughty beacon
#

it still reads something

rigid nebula
haughty beacon
#

hm

#

the i cant see the error

#

i rarely use the return value of scanf

haughty beacon
#

cases

lost niche
#

wdyn

#

wdym

haughty beacon
#

it says that the value is not between the range value

#

limits*

upbeat rapids
#

try removing the 2 printf("Invalid score\n"); lines?

haughty beacon
#

what number did u put to the computer

bronze geode
# rigid nebula Yes?

scanf doesnt return the number you input it returns how many inputs it took(in this case 1)

novel egret
#

It's not in the exercise

novel egret
rigid nebula
lost niche
novel egret
bronze geode
haughty beacon
#

it said that if the value is not between 0 or 100 it should input an error message

novel egret
haughty beacon
#

am i reading wrong?

novel egret
#

It doesn't say to print "invalid input"

haughty beacon
#

ohhh ok

novel egret
#

The grader is automatic, if you print extra stuff "to make it clearer" of course it's gonna fail you

lost niche
#

i honestly dont even know where to start with the second one

haughty beacon
lost niche
#

do I just fine the avg

haughty beacon
#

it would make you if() alot easier and cleaner

lost niche
#

lemme try brb

haughty beacon
bronze geode
#

oh so he is checking if theres inputs there with the first if?

novel egret
novel egret
#

Yeah, you haven't tried much here. Start by calculating the average score

lost niche
#

oh

#

this is making me lose my mind

bronze geode
#

is declaring grade variables required by the question?

lost niche
#

i think so yes

#

yeah it is

bronze geode
#

oh ok

lost niche
#

im gonna try to make it calculate the variable brb

#

avg i mean

rigid nebula
haughty beacon
#

we're here to help each other

#

thank you

#

but like i dont plan on using C as a profession i think

#

im in 11th grade hs

rigid nebula
haughty beacon
#

Sorry for off topic but how do i delete a repositorie on github

rigid nebula
haughty beacon
lost niche
#

yeah I give up wtf

haughty beacon
#

dont give up bro once you get the hang of it it will be easy

lost niche
#

2 am and i feel sick

bronze geode
#

Recursion?

lost niche
#

do I just calculate the avg using the double avg 😵‍💫

bronze geode
lost niche
#

i honestly dont know how

bronze geode
#

Sum of all scores divided by 4

#

(s1+s2+s3+s4) /4

lost niche
#

so printf("avg score: %d", (score1+score2+score3+score4/4));?

novel egret
#

(s1+s2+s3+s4) /4

score1+score2+score3+score4/4

#

Do you see the difference?

bronze geode
lost niche
#

oh yeah my b

#

it says formatted to two decimals points

#

omg

upbeat rapids
#

you should use a float or a double as the type of the avg to avoid truncation

lost niche
#

these instructions omfg

bronze geode
#

Try once

lost niche
#

i used double yes

#

idk how

#

like %0.2d?

#

beside like

#

the /4?

bronze geode
lost niche
#

it made it worse

bronze geode
#

How many decimal points is it showing

upbeat rapids
lost niche
#

No

lost niche
#

Idk anymore

lost niche
#

All g*

bronze geode
#

Could you send a ss of your code

lost niche
#

Omfg my laptop froze

#

Lemme take a pic

#

Wait my laptop crashed

#

Omfg bruh, it’s nearly 3am now

bronze geode
#

damn

#

you should get some sleep

lost niche
#

I can’t, I have to submit this by tmr

#

There’s no way it literally erased problem 2

bronze geode
lost niche
#

I think so

bronze geode
#

then it will be shorter

#

or else long

lost niche
#

I give up sorry for taking time

#

I feel too sleepy

bronze geode
novel egret
#

Go sleep!

bronze geode
autumn mossBOT
#

@lost niche

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

lost niche
#

How do I close btw

bronze geode
autumn mossBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

novel egret
bronze geode
novel egret
#

It doesn't matter that the result is assigned to a float, the truncation happens before that

#

You need to make at least one of the operands a float, e.g. / 4.f

rigid nebula
#

inc is a function

#

main is also a function.

#

scanf aswell