Write a method that returns the number of words in a String….

Write a method that returns the number of words in a String.  The method header is as following:    public static int numWords(String a){  … } For example: numberWords(“one two three four five six”) returns 6 numberWords(“one six”) returns 2 numberWords(“onesix”) returns 1 numberWords(“”) returns 0

Write a method that computes the sum of the digits in an int…

Write a method that computes the sum of the digits in an integer. Use the following method header: public static int sumDigits(long n). For example, sumDigits(50) returns 5 (5 + 0 = 5) sumDigits(234) returns 9 (2 + 3 + 4 = 9) sumDigits(100011) returns 3 (1 + 0 + 0 + 0 + 1 + 1 = 3)

A patient just gave birth to a newborn at 38 weeks. There we…

A patient just gave birth to a newborn at 38 weeks. There were no complications during pregnancy however, during labor the fetus experienced episodes of late decelerations. The nurse is performing a one-minute APGAR on the newborn. The following are their findings: Heart Rate 89, Weak, slow cry, flexes all four extremities, grimace is noted, and the body is pink but extremities are blue. What APGAR score would the newborn receive? (write the number only, eg: 2).