Question: Challenge Activity (JAVASCRIPT) 3.2.2: If-else expression: Detect greater than 100. Write an expression that will print Dollar or more if the value of numCents is
Challenge Activity (JAVASCRIPT)
3.2.2: If-else expression: Detect greater than 100.
| Write an expression that will print "Dollar or more" if the value of numCents is at least a dollar (100 cents is a dollar). Ex: If numCents is 109, output is "Dollar or more".
import java.util.Scanner; public class DetectDollar { public static void main (String [] args) { int numCents = 0; numCents = 109; if (/* Your solution goes here */) { System.out.println("Dollar or more"); } else { System.out.println("Not a dollar"); } return; } } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
