Question: IN JAVA: Write a program using a SWITCH as your main data structure that reads a web address (for instance, www.apu.edu) from the keyboard using
IN JAVA:
Write a program using a SWITCH as your main data structure that reads a web address (for instance, www.apu.edu) from the keyboard using the Scanner and outputs whether this web address is for a government, a university, a business, an organization, or unknown entity:
If web address contains .gov, it is a government web address
If web address contains .edu, it is a university web address
If web address contains .com, it is a business web address
If web address contains .org, it is an organization web address
Otherwise, it is a web address for an unknown entity
HINT: You may assume the domain type will always end in a . and three letters (e.g., .gov, .edu, etc. You will need to isolate just this portion of the web address into its own string and switch on that sub-string.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
