Determines if the input string is a valid lock combination

Assignment Help JAVA Programming
Reference no: EM13704469

Question: Please write the subsequent program

Program Speciation:

Write a Java program that satisfies the given requirement:

Prompts the user to input exactly nine characters, which constitute a valid lock combination.

Gets whatever the user enters and stores it into a String variable, using the the Scanner's .nextLine() method.

Determines if the input string is a valid lock combination - under the given rules:

Part 1: Consists of exactly nine characters.

Part 2: The character at subscripts 2 and 8 must be 'R' - to indicate turning the dial to the right.

Part 3: The character at subscript 5 must be 'L' - to indicate turning the dial to the left.

Part 4: All other character must be one of the digits: '0', through '9' - indicating what number to turn the dial to.

Can someone show me how to write a proper code for this program and how to do it. Thanks

Reference no: EM13704469

Questions Cloud

What is difference between colorname0 byte and db : What is the difference between ColorName0 BYTE "New is Blue ", 0 and ColorName0 db "New is Blue ",  0 ?
Prepare a program in c++ using the class as defined : Prepare a program in C++ using the class as defined below - Then write the main program in another file that will read in some numbers and test out whether your functions all work.
Write a recursive definition that reverses the elements : Write a recursive definition that reverses the elements in intArray between low and high.
Write and debug a mips program : Write and debug a MIPS program that performs the given operations - Display one of the following statements depending on if a>b, or a=b or a
Determines if the input string is a valid lock combination : Write a Java program that satisfies the given requirement - Prompts the user to input exactly nine characters, which constitute a valid lock combination.
Write a program that reads a list of integer : Write a program that reads a list of integer and stores the integers in an array and write a function compact that eliminates all zeroes from its array parameter
Program that will input any four float values : You need to prepare a program to print the given output - write a program that will input any four float values where the four variables are declared in the 'main' function and perform
Explain tap water in making up the solvent mixture : Question- Why would you not want to use tap water in making up the solvent mixture (HCI + acetone) or rinsing out the beaker
Write the proper chemical formula for the compounds : Question- Write The Proper Chemical Formula for the following compounds: Copper(II) nitrate cobalt(II) nitrate, nickel(II) nitrate, iron(III) nitrate, hydrochloric acid, ammonium hydroxide, acetone and dimethylglyoxime

Reviews

Write a Review

JAVA Programming Questions & Answers

  Creates an array of six divsales objects

Write a program that creates an array of six DivSales objects. The program should ask the user to enter the sales for four quarters for each division.

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  What should a comment at the class level contain

How do you identify a comment so the Javadoc tool will recognize it and what should a comment at the class level contain?

  Ask user to enter a list of names

Write a program that ask a user to enter a list of names. When you finish, The program will show the total number of characters in all the names.

  Write java program which simulates flipping of coin

Write a Java program which simulates flipping of coin 1000 times and prints total number of heads and tails. You should create a class.

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Write prolog clauses to express therelationships

Write prolog clauses to express the following relationships, given the parent relationship: grand-parent, sibling, cousin.

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit

  Generate and manipulate music and images

Arrays are a fundamental and versatile tool for representing data of all shapes and sizes In this assignment, you'll see how arrays can be applied to generate and manipulate music and images.

  Write a jsf application that reports the values

Write a JSF application that reports the values of the following system properties of the web server

  I had to call a webservice

I had to call a webservice (1st line of code) and then from there created a loop but keep getting an error every time on the .getBusiness - I don't know what I should be using there instead of getBusiness.

  A java program that reads the records

A java program that reads the records from the golf.dat file and displays them. It also displays the name of the player with the best (lowest) golf score.

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