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 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 WRONGStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started