Write a program that takes two words as input from keyboard

Assignment Help Computer Engineering
Reference no: EM132211515

Write a program that takes two words as input from the keyboard, representing a password and the same password again.

(Often, websites ask users to type their password twice when they register to make sure there was no typo the first time around.)

Your program should do the following:

If both passwords match, then output "You are now registered as a new user.". Otherwise, output "Sorry, there is a typo in your password.".

Input Validation: All valid passwords must contain between 6 and 10 characters, inclusive. Passwords should not be fully numerical (i.e. must contain a mix of letters, numbers, and special characters).

/*Needed for the Scanner class*/
import java.util.Scanner;

public class YourLastNameValidPassword
{

public static void main(String[] args)
{
//To hold the user's input
String a, b;

//to hold the user's input
String open = null;

//A Scanner object for keyboard input.
Scanner a1 = new Scanner(System.in);

//Prompt the user to enter the password.
System.out.println("Please enter your password: ");
a=a1.next();

System.out.println("Please reenter your password: ");
b=a1.next();
if(a.equals(b))
{
System.out.println("You are now registered as a new user.");;
}
else
{
System.out.println("Sorry, there is a typo in your password.");
}
}
}

Reference no: EM132211515

Questions Cloud

Write a program that uses a function matrix to add matrices : Write a program that uses a function matrix_addition {} to add two matrices and put the result into a third matrix .
Take a series of int values as command line arguments : Calculate a total from the values, but add the values that are even, and subtract the values that are odd.
Display a temperature on two 1bit 7segment displays : Write a program using the Arduino Uno to display a temperature on TWO 1bit 7segment displays.
Display the seating chart of a theater : Write a program that can be used by a small theater to sell tickets for performances.Display the seating chart of a theater.
Write a program that takes two words as input from keyboard : Write a program that takes two words as input from the keyboard, representing a password and the same password again.
Perform the addition of two byte sized numbers : Write a program in TASM that performs the addition of two byte sized numbers that are initially stored in memory locations 'num1' and 'num2'.
Write a prolog recursive predicate that tells us : This knowledge base holds facts about towns you can travel between by taking a direct train, e.g., from union station to san bernardino.
Write a program which outputs the numbers from 1 to 80 : Write a program, using nested loops, which outputs the numbers from 1 to 80 in 8 columns and 10 rows.
Write a program using python that asks the user to enter air : Write a program using python that asks the user to enter air, water, and steel abd the distance that a sound wave will travel in the medium.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd