Java exercise, 100% not understand, please help, thanks.

Dear All,

Would you please help. I don't know my teacher saying since Lesson 1, but need to try to do the below program.

Write a program named CalAverage that reads 3 integer and then display the average

result. For example, if the inputs are 10, 20, 30, the system should display20.

Thank you.

----

public class CalAverage{

public static void main(String[] args)..

1 個解答

評分
  • 1 十年前
    最愛解答

    I suggest you to ask a question not ask for an answer

    The steps:

    1. Parse those int from arguments

    // Integer.parseInt

    2. Loop those int and sum them

    // for (int i =0; i < ...

    3. Print out the average value

    // System.out.print

    I will not give you an complete answer, since this is not good for you.

    besides, this program can be done even just read a few pages of any Java book.

    資料來源: I am a Full Time Java Programmer
還有問題嗎?立即提問即可得到解答。