Ultimate Engineering Study Guide - Questions & Answers

BooksStudyCareerCheggMateFor educatorsHelpSign inFind solutions for your homeworkFind solutions for your homeworkSearchengineeringcomputer sciencecomputer science questions and answers#include #include #include #include #include #include #include // for sqrt /* lab: computing stats with lambda functions todo: open and load the values from the file into a list container iterate through the container using for_each compute and printThis problem has been solved!You'll get a detailed solution from a subject matter expert that helps you learn core concepts.See AnswerQuestion: #Include #Include ≪List≫ #Include ≪Vector≫ #Include ≪Fstream≫ #Include ≪Algorithm≫ #Include ≪Random≫ #Include ≪Cmath≫ // For Sqrt /* Lab: Computing Stats With Lambda Functions TODO: Open And Load The Values From The File Into A List Container Iterate Through The Container Using For_each Compute And Print#include #include #include #include #include #include #include // for sqrt/*Lab: Computing Stats with Lambda FunctionsTODO:Open and load the values from the file into a list containerIterate through the container using for_eachCompute and print out the following statistics using ONLY for_each and "in-line" lambda functions (as arguments to the for_each call)sumaverage (the mean)median (you can pre-sort the values if you likestatistical variance: sum of the (differences from the mean)^2print out the values that are prime numbers (tricky!)*/using namespace std;//// LOAD FILE (written for you)//void loadFile(string fileName, list &allValues) {cout value){allValues.push_back(value);}cout
Create a menu that will allow you 5 selectionsfor items and one to exit. Inside the menu you need to read user input todecide which of the 5 selections After a menu item is executed, the screenshould be repainted with the menu until the userspecifies that they want to finish. You need to somehow handle incorrect userinput, but only exit if they choose your exit option For this part, you only need to print a messagefor each of the 5 selections. Next week you willadd functions for each selection.Sample MenuMenu1. Selection 12. Selection 23. Selection 34. Selection 45. Selection 5Enter Your Selection ( x to Exit) ==>Menu Item Functionality You need to bring the system down for maintenance and call the users to letthem know. This selection finds out who is logged in, pulls the first nameand the telephone number out of the addressfile and displays it to thestandard output. The user stu23 has gone home for the day and left his processes running.You want to find those processes and stop them. You want to use thisoption in the future so it will prompt for the user name, find and stop allprocesses started by that user (include an "are you sure" message). It is discovered that two users have the same user id in the address file.This option checks the addressfile for that situation and, if it exists, promptsyou for a new userid which it will fix in the file with. Your Boss has asked for a list of all users, but does not care about theuserid. This option will pull out all users and sort them by last name but theoutput should be : Firstname Lastname Address Town Telephone number The users are storing way too many files in their home directory and youwould like to notify the top 5 offenders. You might want to run this scriptagain for more or less users so this selection will prompt for the number ofusers to identify, check how many files they have in their home directoryand send a list of those users to the standard output.File belowstu1:Tom Arnold:1234 Apple St:Toms River:NJ:732 555-9876stu2:Jack Black:2345 Baker St:Jackson:NJ:732 555-8765stu3::Tom Cruise:3456 Charlie St:Manchester:NJ:732 555-7654stu4:John Depp:4567 Delta St:Toms River:NJ:732 555-6543stu5:Dan Elfman:5678 Zebra St:Point Pleasant:NJ:732 555-5432stu6:Henry Ford:6789 Xray St:Jackson:NJ:732 555-4321stu7:John Glenn:9876 Cherry St:Bayville:NJ:732 555-1234stu8:Jimi Hendrix:8765 Rutgers St:Manchester:NJ:732 555-2345stu9:Marty Ichabod:7654 Hollow St:Wall:NJ:732 555-3456stu10:Mike Jackson:6543 Thriller St:Toms River:NJ:732 555-4567stu11:Ashton Kutcher:5432 Demi St:Jackson:NJ:732 555-5678stu12:Jude Law:4321 Watson St:Point Pleasant:NJ:732 555-6789stu13:Nelson Mandela:2468 Apartheid St:Toms River:NJ:732 555-8321stu14:Jim Neutron:468 Electron St:Beachwood:NJ:732 555-5285stu15:Rory Oscar:135 Academy St:Berkeley:NJ:732 555-7350stu15:Brad Pitt:579 Jolie St:Manahawkin:NJ:732 555-8258stu17:Don Quaker:862 Oatmeal Dr:Wall:NJ:732 555-4395stu18:Tony Romo:321 Simpson St:Beachwood:NJ:732 555-9596stu19:Will Smith:8439 Robot St:Manahawkin:NJ:732 555-2689stu20:Tim Burton:539 Skellington St:Toms River:NJ:732 555-9264stu23:Mel Gibson:274 Raging St:Bayville:NJ:732 555-1234