A top-level domain (TLD) name is the last part of an Internet domain name like .com....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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." For example: 1) If user input is "apple.com", the program should output "It is a second-level domain followed by a core gTLD." 2) If user input is "APPLE.COM", the program should output "It is a second-level domain followed by a core gTLD." 3) If user input is "www.apple.com", the program should output "It is not a second-level domain followed by a core gTLD." (Because we require a single word that precedes a TLD.) 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." For example: 1) If user input is "apple.com", the program should output "It is a second-level domain followed by a core gTLD." 2) If user input is "APPLE.COM", the program should output "It is a second-level domain followed by a core gTLD." 3) If user input is "www.apple.com", the program should output "It is not a second-level domain followed by a core gTLD." (Because we require a single word that precedes a TLD.)
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class DomainValidator public static void mai... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Let S be the portion of the cylinder y = e x in the first octant that projects parallel to the x-axis onto the rectangle R yz : 1 y 2, 0 z 1 in the yz-plane. Let n be the unit vector normal to S...
-
What are the major disadvantages of a mail survey?
-
Let y 1 , y 2 ,..., y n be a random sample from a normal pdf with unknown mean and variance 1. Find the form of the GLRT for H 0 : = 0 versus H 1 : o .
-
Describe the advantages and disadvantages of forming a limited liability company (LLC) versus a corporation.
-
Portia Carter is the president of a company that owns six multiplex movie theaters. Carter has delegated decision-making authority to the theater managers for all decisions except those relating to...
-
16. Using the given data find value of resonance energy of benzene C6H6. AydgH of cyclohexene = -119 kJ/mole AhydgH of benzene = -206.5 kJ/mole (a) -150.5 kJ/mole (b) -325.5 kJ/mole (c) -87.5 kJ/mole...
-
1. What type of attitude scale is used by the ACSI if any? 2. What type of attitude study might you design if you were the consultant? 3. How would you use results from this approach to diagnose...
-
Kaila works for a start-up fashion organization in Los Angeles. She has been working for this company as a Human Resources coordinator for 3 years. Recently, Kaila has been experiencing sexist...
-
Given the company Monail Beauty https://monailbeauty.com/about-us/ Present a trend analysis with references Include explanations
-
Determine the purchase price at the indicated time before maturity of the following bond redeemed at par shown in the table below. Par Value $4,000 Bond Rate Payable Semi-Annually 7% Time Before...
-
Considering that this is a long term, strategic decision, discuss the factors that might change in the next 10 to 20 years and how the possibility of such changes influences the decision. (13 marks)
-
Date Account Title Debit Credit Sept 1 Cash 10,000 Common Stock 10,000 Sept 2 Equipment 5,000 Cash 5,000 Sept 3 Rent Expense 400 Cash 400 Sept 4 Supplies 500 Cash 500 Sept 5 Advertising Expense 250...
-
Briefly discuss the difference between Public Finance and Corporate Finance. (10 marks) QUESTION 2: (15 marks) a) Find the balance in an account at the end of five years if RM2,500 is deposited today...
-
he widget store manager reminds you that while the average number of people that show up each day is 200, the actual number varies. He tells you that the customers that show up each day can be...
-
Find the radius of convergence in two ways: (a) Directly by the CauchyHadamard formula in Sec. 15.2. (b) From a series of simpler terms by using Theorem 3 or Theorem 4.
-
1. Why did the court find for Carey? 2. As noted in the text, in UCC cases judges fill in contract terms where the parties clearly intended a deal. Should the court here fill in the missing terms to...
-
Should the government intervene to improve opportunities for women and minorities in the investment banking industry? The 2010 DoddFrank Act includes a provision creating Offices of Minority and...
-
1. Beyond market share and stock market prices, what considerations would have influenced Hawkinss decision? 2. Some critics have said that Hawkinss decision could not be considered difficult because...
-
In Appendix 16A.1, we illustrate the calculation of a standard error for the marginal effect in a probit model of transportation, Example 16.4. In the appendix, the calculation is for the marginal...
-
In Examples 16.2 and 16.4, we presented the linear probability and probit model estimates using an example of transportation choice. The logit model for the same example is \(P(A U T...
-
In Example 16.3, we illustrate the calculation of the likelihood function for the probit model in a small example. a. Calculate the probability that \(y=1\) if \(x=1.5\), given the values of the...
Study smarter with the SolutionInn App