Course Solutions Uncategorized (Solved) : Hi Written Program Run Difficulties Produce Error Message Input Letters Example User Key 9 Q34744437 . . . .

(Solved) : Hi Written Program Run Difficulties Produce Error Message Input Letters Example User Key 9 Q34744437 . . . .

 

<Java – validate data input>

Hi, I have written a program, it can run.

But I have difficulties to produce an error messageif the input are not letters, for example, if user key in”999999999″ or “995$&*”, how to show an errormessage?

Here is the program:

package assignment

import java.util.Scanner;

public class Assignment {

    public static void main(String[] args) {

     Scanner input = new Scanner(System.in);

    

       

     String phoneLetter; //accept phonenumber to key in as letters

     int i, mark, len; //’mark’ stores thelocation where a hyphen will be placed

     char c;

     Scanner kb = new Scanner (System.in);//taking input from keyboard

   

     do { //use do-while loop to accept thephoneNo with

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Assembly Code Describe Plain English Well Provide C Code Performs Functionality Re Looking Q34867987 . . . .(Solved) : Assembly Code Describe Plain English Well Provide C Code Performs Functionality Re Looking Q34867987 . . . .

<p><img alt="Below is some assembly code. Describe what it does, both in plain English, as well as provide some C code which performs the" src="https://media.cheggcdn.com/media%2F5be%2F5be38263-ee55-49d3-9841-e177a788824b%2FphpqcxhdC.png" style="height:744px;width:673px;" aria-describedby="d3f"/></p>Below is some assembly