Question: (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

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

(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

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!