CSC105SU2021Method1

From BU Computer Science
Jump to navigation Jump to search

First Method assignment

Choice 1

Write a program that displays a list of users and the number of visits to a site for each user. You should include a function that is sent an array of users (previously read from a file) and returns an array that contains a just the unique names. Then write a second function that receives the first two arrays and returns an array with the number of times each user in the unique array arrays in the non-unique array.


Choice 2

Write a program that displays the numbers of values in a file that are less than the average. The program should contain at least two functions. The first is sent an array of numbers (previously read from a file) and returns the average of the numbers. The second is sent the array and the average and it returns the number of values less than the average.