Respuesta :
Answer:
public static double typing_speed(int no_of_words, int no_of_sconds){
double time_in_minutes = (double)no_of_sconds/60;
return (no_of_words/time_in_minutes);
}
Explanation:
- Using Java programming language, a method is created called typing_speed as required by the question.
- The method accepts two parameters of type ints no_of_words and no_of_seconds.
- A conversion of the second parameter (time in seconds) is done by diving by 60 and casting to a double data type
- Finally The typing speed (no of words/minute) is evaluated and returned
- See a complete code snippet with a main method below
public class num10 {
public static void main(String args[]) {
int numWords = 17;
int numSecs = 128;
System.out.println("The typing speed per minute is "+typing_speed(numWords,numSecs));
}
public static double typing_speed(int no_of_words, int no_of_sconds){
double time_in_minutes = (double)no_of_sconds/60;
return (no_of_words/time_in_minutes);
}
}