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

  Administration, performance for the database

According to you what would be the inherent problems of the database auditing if program was not implemented with the careful thought and consideration? Consider administration, performance, and other factors.

  How would it support total quality at boeing

Consider how Deming and TQM would have dealt with (or avoided) the problems at Boeing. What does a TQM initiative look like in an IT department?

  List all authors whose last name contains letter pattern in

List all authors whose last name contains letter pattern IN. Put results in order of last name, then first name. List each author's last name and first name.

  Questiondescribe what java environment would contain to do

questiondescribe what java environment would contain to do if you were trying to pass an arraylist a collection class

  Identify tasks that have an impact on enterprise sphere

Identify task that an employee might perform that would have an impact on workgroup. Identify task that would have impact on the enterprise sphere of influence.

  Write the assignment statements necessary to store the time

Write the assignment statements necessary to store the time 7:12:44 into the Past component of Channel_Crossing.

  Create annotated highlevel design enterprise network diagram

Create an annotated high-level design enterprise network diagram for Reding Health Group. Reding Health Group Business Needs and Network Requirements.

  Must be written in apa format with any and all sources

develop a 350- to 700-word synopsis with the following elementa description of how a specific business requirement

  Modify the pseudocode and optimize

offer valid reasons why the pseudocode is now more efficient.

  Develop a pac chart, interactivity chart

Develop a solution that will calculate the price of an item for each of the five days, given the original price. Test the solution for an item costing $10.00. Develop a PAC Chart, Interactivity Chart,IPO chart, Algorithm, and Flowchart

  How the "right" database design can rarely be decided

The "right" database design can rarely be decided on the basis of normalization principle alone. Do you agree or disagree? explain.

  Questionleft explanation is particularly useful while

questionleft explanation is particularly useful while formattinga. a column of numbers representing your every day

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