Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. Validate Domain names with arrays A top-level domain (TLD) name is the last part of an Internet domain name like .com. A core generic

image text in transcribed

8. Validate Domain names with arrays A top-level domain (TLD) name is the last part of an Internet domain name like ".com". A core generic TLD (core gTLD) is a TLD that is either ".com", ".net", ".org", or ".info". A second-level domain is a single name that precedes a TLD. For example, "apple" in "apple.com" is a second-level domain. Write a Java program that validates a domain name. More precisely, it is supposed to: 1) Use a loop to repeatedly prompt for a domain name. (Use empty string as an indicator for exiting) 2) For each domain name) convert the string to lower cases. 3) Find the index of its period. 4) Extract the substring starting from the period, compare it with the four core gTLD's. 5) If the substring is a core gTLD, output "It is a second-level domain followed by a core gTLD." 6) If not, output "It is not a second-level domain followed by a core gTLD

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

Write down the circumstances in which you led.

Answered: 1 week ago