I do apologize for taking so long to post the question today! I just go mod so I am a bit busy! First question for the quiz! Evaluate: int x=3; int y=18; double z =9.5 double w=3.5 (x%y+z)/w You have 24 hours to respond
I may be wrong. Problem: int x=3; int y=18; double z =9.5 double w=3.5 (x%y+z)/w Answer: _______ 7.857142 Work: (3%18+9.5)/3.5 3 divided by 18 = 0 with an 18 remainder (18+9.5)/3.5 27.5/3.5 7.857142...
Guess xD so int x=3; int y=18; double z =9.5 double w=3.5 (x%y+z)/w I did 3 divided by 18 with 18 as the remainder (18+9.5)+3.5 27.5/3.5 7.857142.... how did i get the same thing o.o no copy took me like 30 minutes...
I will be posting the answer tomorrow and adding a new question. My apologies for lack of posting on this thread!
Ok! So the answer to the problem is: 7.85714 The following people are adavancing to the next round: @Emau @minecraftninja05 @DarthLauren03 Everyone else failed to respond therefore they are eliminated from the contest. Next Problem: Suppose x, y and z are int variables and w and t are double variables. What is the value assigned to each of those variables after the last statement executes? x = 38; y = x - 10 x = 2 * x + y - 3; z = y % (x+ 2); w = 3.0 * y + z + 6.5 - 7 % 3; t = x / 4.0 + 17 / 4 - y % y; You have 24 hours to respond
I may be wrong. While X was 38, we never defined x. Please remember that in C++ all identifiers are case sensitive. If you meant x=38 then: 38 38-10=28 76+28-3=101 28%103=75 84+81.5-1=164.5 25.25+4.25-0=29.5 x=101 y=28 z=75 w=164.5 t=29.5
I did the first 4 in my head/on paper, the last 1 I had help with, all I did was copy the format no answers(which is allowed but unfair) please don't comment unless useful as you are not in this and it does you no good.