Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Write a java program )to do the following steps using 'Ternary conditional' operators: 1-Create a controlling class 2-Initialize string variable for your username and integer

image text in transcribed

(Write a java program )to do the following steps using 'Ternary conditional'

operators:

1-Create a controlling class

2-Initialize string variable for your username and integer variable for your Password.

3-Read any user name and password from the keyboard using scanner class

4- Display the messages as sample input and output if user name and passwords are matching using 'ternary conditional' Operators.

/////////Note: don't use 'if..else' statement////////////

Sample Input-output-1:

Enter your User Name :

sk123

Enter your password:

123

Your User name, password are CORRECT

Sample Input-output-2:

Enter your User Name:

sk123

Enter your password:

456

Your User name and/or password is WRONG

Write a java program to do the following steps using 'Ternary conditional' operators: 1. Create a controlling class 2. Initialize string variable for your username and integer variable for your Password. 3. Read any user name and password from the keyboard using scanner class 4. Display the messages as sample input and output if user name and passwords are matching using 'ternary conditional' Operators. Note: don't use 'if..else' statement Sample Input-output-1: Enter your User Name : sk123 Enter your password : 123 Your User name, password are CORRECT Sample Input-output-2: Enter your User Name : sk123 Enter your password : 456 Your User name and/or password is WRONG

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions