Methods in java (grade calculator)

后端 未结 6 1899
醉酒成梦
醉酒成梦 2021-01-29 06:49

We\'ve been learning about methods in java (using netbeans) in class and I\'m still a bit confused about using methods. One homework question basically asks to design a grade ca

6条回答
  •  不要未来只要你来
    2021-01-29 07:04

    To start :

    1) Follow coding conventions. (Class name should start with a capital letter).

    2) In your context, you don't need Scanner in = new Scanner(System.in); in main() because you are not using it.

    3) You are a calling the method scoreCalc() without parameters. Whereas, the method needs to be called with parameters.

    4) A method,is a module. It as block of code which increases re-usability. So I suggest that accept the values from user in main() method and then pass them to the method for calculation.

提交回复
热议问题