Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 numberStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started