Instantly share code, notes, and snippets.

# udacityandroid/Option A Last active Jun 23, 2019

Android Development for Beginners : Calculate the Price Method
 /** * Calculates the price of the order based on the current quantity. * * @return the price */ private int calculate price(int quantity { int price = quantity * 5; return price; }
 /** * Calculates the price of the order based on the current quantity. * * @return the price */ private calculatePrice(int quantity) int price = quantity * 5; return price;
 /** * Calculates the price of the order based on the current quantity. * * @return the price */ private int calculatePrice(int quantity) { int price = quantity * 5; return price; }

### Fideas commented Jul 9, 2015

 @royalbrawler There was no need to put the answer in plain text without even a warning for future students.

### HPr0ndelo commented Jul 12, 2015

 Yea, as someone who likes to figure out the answer for myself, I prefer not seeing it in the very first comment. you're a dick @royalbrawler

### gamesnepal commented Jul 16, 2015

 Yeah, don't answer the question here. Do it in the quiz.

### domdomegg commented Aug 11, 2015

 SPOILER It is either A, B or C.

 nice

 c

 c

 Its C

 C ✌️

### sandeepkumarp commented Oct 24, 2015

 Option A has missing closing bracket and option B has missing curly brackets that shows the block length.

### akarsh commented Nov 4, 2015

 Option C

### smithThapa commented Nov 4, 2015

 Why are people so stupid ? Just answer in quiz not here. There are future students too...

### malibaig786 commented Dec 2, 2015

 Hello Everyone I am doing these courses from google. Lets do it together if any one wants to contact me one malibaig41@gmail.com

 C

 C

 c++

### KalpeshMangukiya commented Feb 26, 2016

 Option C

### SergioMendesBorges commented Mar 1, 2016

 Option C 👍

### dmir23 commented Mar 13, 2016

 Option C

### gulzaar commented Mar 14, 2016

 option C

### iwzmax commented Mar 26, 2016

 Lol it has to be one of the three

### davidkadiata commented Mar 28, 2016

 it is C

### joaohenriiquee commented Mar 30, 2016

 LOL, option C.

### ARTNS commented Apr 9, 2016

 a and b have ERRORS, so has to be Option C

### necrtd commented Apr 12, 2016

 it is C

 good,C

### formatCEnter commented Apr 28, 2016

 The goal isn't to "just get through the course". The goal is to learn. If someone so lacks self-restraint that they post what they think the answer is, do you really trust their judgement? That said, if you're not that familiar with Java, here's a hint. One of the answers breaks method naming conventions, and one of the answers doesn't tell you what kind of variable will be returned. More colloquial: If you want to send some stuff to a method and get something back (not to the screen, but that you want to do more work on) you have to say what kind of thing you want back right near the beginning of the actual code of the method.

### NandaHayatun commented Apr 29, 2016

 option C is correct

 C

### angel-tren commented May 22, 2016

 Respuesta C.. La B no tiene las llaves de entrada y cierre.. La A le faltan unas cosas y el )

### nassimjd commented Jun 22, 2016

 I wish comments were turned off for this type of question.

### fer408 commented Jun 26, 2016

 its a given c

### agusarfi commented Jul 9, 2016

 Don't look in comment before you guest it. Programming need bigger effort than only cheating.

 C

 C 💯

### aivydebnath commented Aug 27, 2016 • edited

 Answer is Option C because in Option A ")" is missing. and ind in option B return type is missing and brackets are also missing.

 C

 C

### camango commented Sep 13, 2016

 But if somenone put right answer then should explain it i guess

### Zoyisile commented Sep 20, 2016

 I also choose option C

 C

# C

### robintyagi289 commented Sep 27, 2016

 Definitely C is The Correct Option.Syntactically And Logically

### sokkhimk commented Oct 4, 2016

 It is C.

### BhavyaDJ commented Oct 14, 2016

 option C

 Its C

### Rafiik commented Nov 28, 2016

 Does anyone know why his tutorial are not available anymore? Its says it is exsist anymore.. :(

 its C

 c

### Zifthis commented Dec 22, 2016

 people are so dumb commenting a correct answer. WHY WOULD YOU SPOIL ITTTTTTTTTTTT

### erbesharat commented Dec 30, 2016

 I can't understand why people keep commenting correct answer here 😠

### Mahmoud-fci commented Dec 31, 2016

 Option C

### LittleFlower2019 commented Jan 1, 2017

 haha! I like it!

### nabarun1011 commented Jan 2, 2017

 The course is too much slow xD

### ridharezzag commented Jan 17, 2017

 why there so many stupid people dont answer the question here

 42

 izi c

 C

 C

### Mostafayehya commented Feb 23, 2017

 The answer shall be C .

### PedroP1res commented Mar 2, 2017

 Come on guys , Spoiler warnings !!!!!!!!

### MakerShooter commented Mar 3, 2017

 There is no ) at the first anwser and there is no {} under the secon anwser. this semantic depends on programming language - so we have to learn how the language is created so for java it is lik that.

 thanks

 c

 :D lol

### 7ee1aa commented Mar 14, 2017

 Heh... More spoiling .D .D You guys are funny .D

### nairotearP commented Mar 25, 2017

 Perhaps disabling comments would fix everyone's problem.

 C

### gurutecno commented Apr 8, 2017

 La respuesta correcta es la C.

### christianputzu commented Apr 8, 2017

 I think it's option C.

### bhargavsasani commented Apr 10, 2017

 I am happy to see that student are happy to share that what they had to learn and what they can do and it is google which made a better course as we know and anyway google working for them and we should work for ourselves there are some people worried about why student comment there about the correct answer but you should understand that they are very happy with the android free course if you not commented real answer on this page, no problem, but why you have a question about them(real student). it is students behavior that they can not stop himself to stop to write the answer because they know something else, thanks google for some awesome work, might be it is for your indirect profit. complainers should understand that students are not as you, and you are not as them. and on this earth, every person are different everyone is correct by self, might be not by your way. so live by your way, then you would realize that how the world is really, really true. there is no mistake and you can't find by anyway. I am 16 years old but know the truth about this earth `````` - student android developer (udacity) ``````

### tudor-paraschivescu commented Apr 11, 2017

 C for sure

### neliamx4 commented Apr 11, 2017

 @bhargavsasani well said!

### AdriaticHeart commented Apr 12, 2017

 doesn't matter is the answer is posted, the point is to examine understand WHY this is the answer and you will get the same out of it:) Did u notice the brackets?

### AlisonOliveira commented Apr 18, 2017

 opção C

 C#

 is C

 is C

### AngaKoko commented May 16, 2017 • edited

 Haha, getting help is part of what we are being taught :)

 C

 C

### badeyemo commented May 24, 2017

 Option C is correct!

### frayvier commented May 25, 2017

 Option C follows basic java syntax for defining methods!

 C

### pregenRobot commented Jul 16, 2017

 The answer is obviously d! Cmon guys be more serious

 c

### Guille55 commented Aug 26, 2017

 Hint: is option A or B or C

 C

### Soundharyaam commented Sep 18, 2017

 Yeah. It's C.

 C

### ShaiGotlieb commented Oct 10, 2017

 Option C is the correct answer

### FranzoJosefo commented Oct 17, 2017

 Why would you even answer here?

### rpgomes commented Nov 10, 2017

 Option D

### nkemjikaevans commented Nov 14, 2017

 option c

### SKREFI commented Nov 23, 2017

 STOP Answearing here!

### Einsomnia commented Dec 2, 2017

 Definately, the answer should be "C"

### dbelisario commented Dec 21, 2017

 La opción A tiene un error de declaración en el nombre del método, la opción B carece de criterios en la declaración del método, mientras que la opción C esta escrita de manera correcta. C is the correct answer

 C

 C!

 C : )

 c

 c

### ludwigschubi commented Jan 6, 2018

 This quiz was somehow not about programming, but java syntax. Kind of useless in my opinion, since you can look up syntax all the time, but actual logical understanding of what you are doing has to be teached. Sometimes i can not see how that is present within the course.

 c

 c

 It's C

 c

### dennisotugo commented Jan 25, 2018

 dab dab dab dab dab dab

### isijackson commented Jan 27, 2018

 Option C

 C

### lkings40 commented Feb 2, 2018

 Option C

### aydinaytac commented Feb 3, 2018

 Option C is the correct one ;)

### MarwaAdel commented Feb 3, 2018

 c is correct

### Maxwe1 commented Feb 3, 2018

 C, of course.

 C, :)

### LindenShield commented Feb 5, 2018

 The correct answer is C because the close brace aren't missed.

 c

### SHAIMAAHASSAN commented Feb 6, 2018

 c is correct as 👍 a-is missing( b-missing int as when define method and return value should write the type of return value (int,String,.....)

### nepara90 commented Feb 6, 2018

 C is correct

### TheBaileyBrew commented Feb 6, 2018

 Why is everyone answering here? - it defeats the purpose of having this gist available for future students who want to figure it out on their own.

### Nogaeman commented Feb 7, 2018

 The Option Is C

### LailaHussain commented Feb 8, 2018

 The correct option is C.

### abdullahelsheikh commented Feb 9, 2018

 -A: IS WRONG because exist space in method name . -because does not between a pair of parentheses -B: Is Wrong too because the body does not between braces, {}. Option C is Correct because all conditions is true

### mohamedyossri4 commented Feb 10, 2018

 Option A: is incorrect as the closing bracket after int quantity is missing Option B: is incorrect as Opening and Closing "{" are missing Option C: is correct method

 C

 C

 C

 c

### home2mars commented Feb 22, 2018

 LOL ...... The owner of this gist should have TURN OFF the comment section. You are not supposed to answer the question here. You are doing disservice to future students.

### sarovarsubedi commented Feb 25, 2018

 dont understand why people insist on providing the answer !!!

### alarek commented Feb 25, 2018

 Why are people so stupid ? Write your answer in quiz not here

 C

 C

 c

### cvikvi commented Mar 6, 2018

 Guys you answer on the video not here. This is the equivalent of yelling out the answer on a test. Two you're kind of showing you have no self restraint. She literally walks people through why each answer is right and wrong.

### miaadib commented Mar 8, 2018

 really we are in class y all answer here bcuz how we will know who is understand this lesson or no all will be same bcuz most of them will copy this answer without know why choose this

### derekshum2 commented Mar 11, 2018

 it is c

 c

 C

### DarthChowder commented Mar 18, 2018

 Why are you all posting the answer. There are people that need to think it over for themselves and learn. Don't just give them the answer.

### louayeldin commented Mar 18, 2018

 Stick with option C private int calculatePrice(int quantity) { int price = quantity * 5; return price; } Reasons: because its declared according to the guidelines and also its return the result as an integer

 C

 C

 C

### apitimur commented Mar 23, 2018

 Yeah, we learn something here. Better if we don't write the answer here

 c

### wefacd2wedcs commented Mar 27, 2018

 I think it's E but it might also be D

### lakshmiprasannatirumala commented Apr 1, 2018

 option c is correct. There are syntactical errors in A and B

 C

### djames2018 commented Apr 12, 2018

 I think its C

### Udaypratap3 commented May 4, 2018

The answer is C because it follows the proper syntax of declaring a method

## private returnType methodName(parameters){

}

 its c

### shoooka commented May 10, 2018

 CCCCCCCCCCCCCCCCCCCCCCC

### KingKiitt commented May 11, 2018

 Why do people keep answering it here? I mean, it's kind of obvious because there's not much difference between the codes but give other students a try to think for themselves.

### dev-ali-mansour commented May 11, 2018

 Option C is the correct answer because method naming is like variable we can't put space in method name

### OmkarSahasrabudhe commented May 12, 2018

 Option C

### parupalli commented May 19, 2018

 option c

### Eduese commented May 21, 2018

 I think this space is to help us in answering the videos questions, hence the codes option.

### Bashirok commented May 23, 2018

 The student who comment the answer really shouldn't, I know you might find it entertaining for your crummy little minds, but it isnt for the new students. But its okay i don't need an explanation, hope is lost i can't sit here in desperation, waiting, Hopping but nothing changes, its okay i'm used to it, All hope is lost i cant sit here rambling hope some else finds this interesting. Definitions (for the un-educated students who think its okay to comment the answer) Crummy: Dirty, Broken Desperation: A state of despair Rambling: lengthy and confused or inconsequential.

### elharmouchi commented May 25, 2018

 Option C is correct

 C

 C

### NtaoMoloi commented May 30, 2018

 I also don't understand why others post their answers here when they should just compare the methods and go back to the video quiz to answer.

 c

### Rufyda commented Jun 2, 2018

 الاجابه هي رقم c

### gagoor commented Jun 2, 2018

 Option C

 c

 c

### mahmoudkashef commented Jun 6, 2018

 Guys stop answering it here !!

### tooptooptoop commented Jun 7, 2018 • edited

 c /** Calculates the price of the order based on the current quantity. @return the price */ private int calculatePrice(int quantity) { int price = quantity * 5; return price; }

### Yahia-Sayah commented Jun 13, 2018

 Option C

### Fury4hwxc commented Jun 13, 2018

 Option C because The reason is in the first choice and second choice there is similarity is mistakenly call the name must not contain a space السبب لان في الخيار الاول و الخيار الثاني يوجد تشابه بالخطا وهو عند الاستدعاء اسم اي متغير يجب الا يحوي مسافة

### Haapiiiii commented Jun 14, 2018

 option c is the correct answer

 c

 lol C

 C

 C

 c

 a,b,c

### mhmhussein commented Jul 3, 2018

 option C

### Nicanor008 commented Jul 9, 2018

 option C

### tanwarrohit825 commented Aug 2, 2018

 option C is the correct one

### luismartinezs commented Aug 5, 2018

 this is so ridiculously easy who cares whether they say the solution in the comments...

### Eisman333 commented Aug 8, 2018

 I don't get the fuss about the answer being in the comments, just don't scroll down that far to begin with. Look at the code and ignore the comments entirely. Besides, it is about figuring out why not just the answer and for that you'd have to scroll even further and that's definitely on you then. Not to mention after looking at the code most people will quickly realize that @saito200 is entirely right

### jerrychong25 commented Aug 21, 2018

 Option C

 C

 C

 c

 C

 C

 c

### Yogesh-Bhati commented Oct 3, 2018

 Option C

 c

### Usha3012 commented Nov 13, 2018

 C is correct way. A: )missing after passing the argument B: { is missing which include implementation

### sagerfarhan commented Nov 19, 2018

 option c is correct

 C

### NADAASHRF commented Dec 14, 2018

 option C

### sps619 commented Jan 14, 2019

 I'm the future student, they are talking about!

### djalilo24 commented Mar 23, 2019

 C is correct A espace (calculate price) false B } (Arc closure) false