Question: Integer userVal is read from input. Assume userVal is greater than 1 0 0 0 and less than 9 9 9 9 9 . Assign

Integer userVal is read from input. Assume userVal is greater than 1000 and less than 99999. Assign onesDigit with userVal's ones place value.
Ex. If the input is 18579, then the output is:
Value in ones place: 9
import java.util.Scanner;
public class ValueFinder {
public static void main(String [] args){
Scanner scnr = new Scanner(
System.in);
int userVal;
int onesDigit;
userVal = scnr. nextInt ();
Y** Your code goes here */
System.out.println("Value in ones place: "+ onesDigit);
}
}
 Integer userVal is read from input. Assume userVal is greater than

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!