CMPS-3350 Lab-8 - programming challenge C++

Overview... This lab is a simple example of data scraping. Getting data onto your screen, then collecting and processing the data. We will scrape data from Odin. Start with your 3350/6/bugsbunny.cpp program. • Write a program on Odin named /3350/8/uvlab8.cpp • Please include a Makefile that builds your program(s).
Program details We are writing a Linux utility program. We want to know how many users are logged in once, twice, 3-times, 4-times, etc. Use the Linux w utility to create a file, then scrape the file. sample output...
$ ./uvlab8 Odin current login statistics ----------------------------- 1 login: 12 users 2 logins: 5 users 3 logins: 1 user 5 logins: 1 user
One strategy to try: Put the file records into an array. Sort the array. Read through the sorted array. Count how many reads until the username is different. That is a user logged in 'count' times. Use 'count' as an index into a hash table. Increment the hash table at that index. Continue through the sorted array. Display the output. Using the strategy above... 1 2 3 5 are indexes of a hash table 12 5 1 1 are the values stored at those array indexes. Rules... Do not use the STL, vectors, <algorithm>, etc. If you find any code online... 1. Put the URL in a comment. 2. Briefly explain why you could not write the code yourself.
Program files to be collected... 3350/8/uvlab8.cpp 3350/8/Makefile
Unit test 1. Create a data file with known values. This file will contain data in a structure similar to the file your program will construct for the live Odin data. To do this Unit Test, run your program like this: ./utest myfile.txt When your program sees a command-line file name, it will use that file for a test rather than scraping live data from Odin server. You must put this functionality in a second executable. This compile option will activate your Unit Test... -D UNIT_TEST Isolate all unit test functionality from your production program using #define pre-processor directives. Gordon will test your program with live data, and unit-test file input.