0
Someone to help me make a code in Java netsbeans, using Newton's second law, a calculator type :c
6 Respuestas
+ 2
https://code.sololearn.com/caGsaW8VEfUl/#java
I add extra comments and assigning value inside fisica to understand what each variable is going to be.
Obs: on SoloLearn need put all inputs, so on this case need put or input "4" and program will do nothing. Or multiple of 3 (choice + value 1 + value 2) (how many want, then 4) till need end program and choice input 4.
Else the program will throw NoSuchElement. But it is because SoloLearn
+ 1
We can help, but post your self code done and we help a bit.
+ 1
-(LOW) There no reason static Scanner, but not wrong, personal opinion.
- (Medium) Tip, indeed code, add tabulation, so you can easyle see what is inside what.
- (LOW) Can change print to println, it add \n in the end automatically.
- (MEDIUM) project is only your? But good be specific, "add masa" per example can specifics if in kilo or libras.... Force in Newtons, acelleration m/s^2. And type just numbers, else you should handle exception and cast.
- (MEDIUM) fisica method have three condition, but last is just else, how method is public anybody can call it, so I could call fisica(5, x, y), and it will calcule force instead. You can or add if(a==3) and else throws error, or set private so no one will call it.
- Logical (GRAVE): fisica method you're calculing wrong, are you doing math with "a" variable, but "a" it's just the choice, not massa neither force neither acceleration.
- (LOW) you can remove case 4, it is doing nothing and there no default, so just jump it.
+ 1
Wow Thank you very much my friend, you have saved me
0
This is the code I currently have, but I think it's all wrong :c