Page 1 of 1

Question 8 ( 3 mark) : Define two classes. The first class contains the main method that creates an object of the second

Posted: Thu Jul 14, 2022 2:12 pm
by answerhappygod
Question 8 3 Mark Define Two Classes The First Class Contains The Main Method That Creates An Object Of The Second 1
Question 8 3 Mark Define Two Classes The First Class Contains The Main Method That Creates An Object Of The Second 1 (41.14 KiB) Viewed 38 times
Question 8 ( 3 mark) : Define two classes. The first class contains the main method that creates an object of the second class and then calls its method. The second class contains a method calcDivision that takes 2 integer arguments and returns the division of the first number by the second (what data type should be returned?). You will need to think about have data types are converted in Java. REQUIREMENTS - The user input is always correct (input verification is not required). - Assume each of the two inputs are of int type. - Your code must use the Scanner class to read the user input. - Your code must include 2 classes. - Your code must work exactly like the following example (the text in bold indicates the user input). Example of the program output: Enter the first int number: 5 Enter the second int number: 8 The division of 5 by 8 is 0.625