Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions