Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Language: JAVA Package name: exerl ----- Class name: Pexerl This class should solve the problem specified as follows: A host can be accessed using

image text in transcribed

Programming Language: JAVA Package name: exerl ----- Class name: Pexerl This class should solve the problem specified as follows: A host can be accessed using a dotted format such as (www.yahoo.com). Explore the InetAddress class within the java.net package. Some of the methods within this class are as follows: bytel getAddress String getHostAddress String getHostName() static InetAddress getLocalHosto static InetAddress getiByName(String hostname) static InetAddress I getAllByNamei(String hostname) Objectives: Create a program that will look up a variable number of hostnames: - The program will ask for the name of a host to search and then immediately display the host names and IP addresses associated to the host given by the user. The program will then ask the user if he/she wants to search another host (if yes, repeat the process above, otherwise, exit the program). Sample run of the program: Blue mark: input of user Host 1 - Type host name: yahoo.com Number of host(s)/IP(s): 6 Green mark: output of program Host name: yahoo.com IP address: 74.6.143.25 Host name: yahoo.com IP address: 98.137.11.163 Host name: yahoo.com IP address: 74.6.231.20 Host name: yahoo.com IP address: 98.137.11.164 Host name: yahoo.com IP address : 74.6.231.21 Host name: yahoo.com IP address: 74.6.143.26 Search another [Y/N]? y Host 2 - Type host name: csvu.edu.ph Number of host(s)/IP(s): 1 Host name: csvu.edu.ph IP address: 122.53.179.133 Search another [y/N]? n Process finished with exit code o

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

LO2 Discuss important legal areas regarding safety and health.

Answered: 1 week ago