5. Write a program in Java to accept 10 different 3 digit numbers in array and
calculate the sum of all numbers that is multiple of both 2 and 3 present in
that array using function.
Instance variables/Data members:
int a []
: to store the 10 numbers
Rest of the variables can be assumed as required according to the logic of the
program
Instance Methods:
void accept ()
: to accept 10 different 3 digit numbers in an array
using an input statement.
boolean check (int x) : to check the argument is multiple of both 2 and 3
or not. If yes then it returns true otherwise it returns false.
void display ( )
: to display all the numbers and their position in that
array that is multiple of both 2 and 3. Finally display the sum of all numbers
that is multiple of both 2 and 3 present in that array with proper message.
Write a main () to call the method using an object to perform the task.
Answers
Answered by
0
Answer:
Draw a diagram to show the process of insolation.Draw a diagram to show the process of insolation.Tap on a clip to paste it in the text box.
Similar questions
Biology,
3 months ago
Computer Science,
3 months ago
English,
6 months ago
History,
6 months ago
English,
10 months ago