Question: C++ WITH STRUCTURES AND STRINGS In this program you are going to simulates the DNS by using a structure called MyHost. The information in MyHost
C++ WITH STRUCTURES AND STRINGS
In this program you are going to simulates the DNS by using a structure called MyHost. The information inMyHost structure includes the host name and its IP address.
To create the DNS database, you need to read the host names and the corresponding IP addresses from a file. The file has the following format:
Number_Hosts_in_Database
Host_Name IP_Address
Host_Name IP_Address .. .. ..
And so on
You can use the provided DSN.txt file to create a dynamic array of MyHost structure and store the information about all given hosts.
When the program runs, it should prompt the user to enter a host name and query the database for the corresponding IP address. If the host exists, display the host name and its IP address on the screen. Otherwise, inform the user that the host name does not exist in the database. The user should be able to search as many hosts as he/she would like ( your program should not quit after the first host!).
DSN.txt file contains:
www.hellotamu.com 111.115.14.27 www.hellocosc36.com 168.143.199.41 www.aggies2.com 242.244.94.55 www.goaggies.com 28.30.120.51 www.whitetamu.edu 210.21.205.183 www.maroontamu.com 42.186.174.12 www.cosc1436.com 66.44.172.169 www.hellowhite.com 178.27.160.159 www.hellomaroon.com 242.176.138.168 www.gotamu.org 20.208.30.151 www.codetamu.org 245.112.154.68 www.mytamu.edu 252.218.111.238 www.theutuni.com 187.214.135.204 www.seemaroon.com 81.185.145.61 www.byered.com 72.169.132.211
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
