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

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!