Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

Create a new BlueJ project

  • Posted
  • Authoradmin
  • Length289 words
  • Reading time2 min
Write My Assignment FREE

Create a new BlueJ project called your username-A1Q5. For example, mine would be nfrancis10-A1Q5.

Inside the project you will need to create two classes, which is PartA and PartB.

Part A:

Imagine you need to open a standard three digit combination dial lock. Write a Java program in BlueJ with a method that prints all of the possible combinations. If the three digits combination have all the same number, replace it with “jackpot”. Assume the numbers on each dial range from zero to nine and three numbers in sequence are needed to open the lock. For example, the output would look like:

0-0-0 -> “jackpot”

0-0-1

0-0-2 ->

// lots more combinations 9-9-8 ->

9-9-9 -> “jackpot”

Part B:

Suppose the lock isn’t a very good one and any number that’s no more than one away from the correct number in each digit will also work.

Write another method that takes 3 parameters of type int that are the combination of the lock. The method will print out a minimal list of combinations you would need to try to guarantee opening the lock.

For example, if the combination is 7-6-3 then 7-5-4, 6-6-2, 8-5-3 and other combinations will also open the lock. The first combination printed would be 6-5-2 and the last would be 8-7-

  1. You will also need to make sure that no number in the combinations that are printed is less that zero and greater than nine as the numbers on each dial range from zero to nine.

The post Create a new BlueJ project appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order