Require to enter the correct passcode to start application

Assignment Help Computer Engineering
Reference no: EM132163002

Users are required to enter the correct passcode to start the application.

The system uses a scramble keypad with a randomly allocated set of numbers from 0 to 9.

The display shall show "Enter passcode" initially, and show an asterisk (*) for each number entered.

Upon pushing the "Enter" button, the system verifies the passcode.

If the passcode is correct, the system invokes a method called startApp() to start the application. Otherwise, it displays "Wrong passcode".

The "Clear" button shall clear the display. Assume that the following methods are available:

// return the passcode

public String getPasscode(){

//Random rnd = new Random();

//String passcode4digit = rnd.nextInt(10) + "" + rnd.nextInt(10) + "" + // rnd.nextInt(10) + "" + rnd.nextInt(10);

String passcode4digit ="7312";

return passcode4digit;

}

// Start the application public void startApp(){

System.out.println("Application started"); }

// Shuffle (Randomize) the given int array, e.g.,

// int[] numbers = {1, 2, 3, 4, 5};

// shuffleArray(numbers);

// randomize the elements

public void shuffleArray(int[] ar)

{

Random rnd = new Random();

for (int i = ar.length - 1; i > 0; i--) {

int index = rnd.nextInt(i + 1);

// Simple swap

int a = ar[index];

ar[index] = ar[i];

ar[i] = a;

}

}

Reference no: EM132163002

Questions Cloud

Price function by inverting the demand function : Here is a linear demand function: .5Q = 15 -2P. Find its price function by inverting the demand function. Then find its total revenue function by multiplying
Measure the size of an economy : Are there limitations of using GDP to measure the size of an economy?
Area of managerial economics : Using Isaiah 55:1-5 and Daniel 5:17-31, what are some ideas on how the Bible guides in the area of managerial economics. Provide workplace examples.
Find the book value at the end of yr : A machine was purchased by a company four years ago for $8,000. Estimated salvage value is $1000 at the end of its 10 years life.
Require to enter the correct passcode to start application : The system uses a scramble keypad with a randomly allocated set of numbers from 0 to 9.
Example of the price floor set at zero : Discuss your own conclusion regarding what should be done about organ shortage, including references to the sources you used.
How do government finance budget deficits : 1. How do government finance budget deficits? 2. Government debts are not a problem for countries. Discuss?
What is the total number of header bytes transmitted : What is the total number of header bytes (including TCP, IP, and Ethernet headers) transmitted?
Display the customers company name : Display the customers company name, address, city, region, employee last name, order ID and the order date for orders.

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