Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

 Course is completed. The course result can no longer be changed.

Java Basics (Parent ENG)


Home  Course  3. Conditions and Loops 
Practice 
Exercise 1 "Meet an Agent"

COURSE DISCUSSION PROGRESS

Exercise 1 "Meet an Agent"


The purpose of this exercise is to familiarize you with simple conditional statements.

Estimated workload of this exercise is 20 minutes.

Description
Please, proceed to MeetAnAgent class and write a program that:

Asks for an input number


If the input equals to the secret password number, prints "Hello, Agent"
Otherwise, prints "Access denied"

Secret password is stored in final static int PASSWORD.

Example
Input:

 133976
Output:

Hello, Agent

Input:

711

Output:

Access denied

Autocode (External resource)


100.0 / 100.0 points
Course is finished. You are not able to edit the
answers given. The course is available in a preview
mode only.
 Navigation

You might also like