0
Instance variable: int m[11]
methods: void accept(): to accept marks of 11 subject void compute(): to find percentage void display(): to display percentage This is one of my attempts: https://code.sololearn.com/c8wDX2o0WS1l/?ref=app //how can i accept marks of 11 subject....help me
12 Respostas
+ 4
tell me..
you facing a problem to take 11 marks of subject
+ 4
Harsh Agrawal
---------------------------------------
Owenizedd
give you a way..
you try to understand that..
or give me time..
i provided you some eq.
+ 3
in the void accept() you have to put loop :
for(int i =0; i<m.length; i++)
then inside loop use
m[i] = Integer.parseInt(sc.nextLine());
where sc is your Scanner object variable name.
code:
EDIT: you mean passing to the parameter right?
i assume you have a class.
then it should be pretty easy.
public class MyClass{
int[] m = new int[11];
void accept(int[] mt){
m=mt; //accept the mt to m
}
//.... another method
}
+ 3
listen first..
when you create a function..
and call through main..
then
what instance variables you used in that function..
you dont need anything...
to give value
wait i creat you program..
give me 5min
+ 2
check updated answer
+ 1
Owenizedd how can i accept dat vaiable
+ 1
Arun Tomar plzzz give me suggestion or give some eg
plzzz
+ 1
Arun Tomar check my updated question
+ 1
Okkk Arun Tomar
I m waiting
+ 1
https://code.sololearn.com/c9Xl9XGRkjFc/?ref=app
are you looking this way
0
Arun Tomar i just want to know how can i accept d variable of m as it is an array type
here i just try but i dont make d whole program as i m confused how i accept m varible so u can understand from my code what i want to do???
https://code.sololearn.com/c8wDX2o0WS1l/?ref=app
0
Arun Tomar U dont accept any variable thats not what d program saying plzzz make according to d program
I just give an eg to make my question understand properly
As like in dis program i accept d variable
https://code.sololearn.com/cdSp5HW4xy5K/?ref=app