Question: using net beans 1. Write a Java program that: Declares and initializes an integer variable. This number will represent a mobile number in Jordan. The

 using net beans 1. Write a Java program that: Declares and

using net beans

1. Write a Java program that: Declares and initializes an integer variable. This number will represent a mobile number in Jordan. The value assigned to the variable must be in the format (79xxxxxxx or 78xxxxxxx or 77xxxxxxx). Do not add zero in the beginning since Java will consider the number in the octal base and we want the number in decimal. For the declared number, your program must identify the number according to the following: o If the number does not consist of exactly 9 digits or if the leftmost digit is not 7, your program must print the statement Sorry, not a valid mobile number in Jordan!. o If the number is valid, it should identify to which telecommunication company it belongs based on the second digit from the left as follows: If digit = 9 print the statement Zain number. If digit = 8 print the statement Umniah number. If digit = 7 print the statement Orange number. Test your program by changing the value of the integer variable for the different cases: Invalid number (both not consisting of 9 digits and not beginning with 7), Zain number, Umniah number, and Orange number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!