Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using basic java program Question 1 - Password Encryption (4 pts) Write a complete program that asks the user prompt a number with 6 digits
using basic java program
Question 1 - Password Encryption (4 pts) Write a complete program that asks the user prompt a number with 6 digits and output the encrypted password. Your program should behave as follow: 1. Display a welcome message. 2. Ask the user for the input number. 3. Use a constant variable to store the input value in the program. 4. Display the encrypted number, which is equivalent by 1) Swap the 1st and 6th digits 2) Replace the second digit with the remainder of the second digit divided by 2. 3) Add 1 to the third digit of your input. Note that if the third digit is '9', the third digit will be 'O' after Step 3), and there are no further changes to other digits from Step 3). Hint: use the remainder of the third digit after Step 3) divided by 10 to handle the possible overflow. 4) Replace the fourth digit with the remainder of the third digit divided by 3. 5) Swap the 4th and 5th digits. COMP248/Winter 2021 - Assignment 1 Page 1 of 4 5. Display a farewell message, so that the user knows that the program has terminated normally. Following are the sample screen shots to illustrate the expected behavior of your program. Assume a perfect user who will always enter a correct input with 6 digits. Note: Your program must display the same information and formatted the same. ******************************************************************** Welcome to Password Encryption Program ****************************************** Please enter a 6-digits number : 123456 Generating the encrypted number... The encrypted 6-digits number is : 604511 Thank you for using password Encryption Program! Ciaure 1 Samnle autout of question tt1Step 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