ব্রুস এক্কেলস গতিবেগের গণনা করার অনুশীলনে, v = s / tযেখানে গুলি এবং টিগুলি পূর্ণসংখ্যা হয়। আমি কীভাবে এটি তৈরি করব যাতে বিভাগটি ভাসা ভাসাচ্ছে?
class CalcV {
float v;
float calcV(int s, int t) {
v = s / t;
return v;
} //end calcV
}
public class PassObject {
public static void main (String[] args ) {
int distance;
distance = 4;
int t;
t = 3;
float outV;
CalcV v = new CalcV();
outV = v.calcV(distance, t);
System.out.println("velocity : " + outV);
} //end main
}//end class