Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago