Question

Write pseudo-code to solve the problem using MapReduce and explain how it works. Each line in...

Write pseudo-code to solve the problem using MapReduce and explain how it works.

Each line in the file lists a person’s ID, name, age, and the number of friends he or she has. For example line 1 indicates that the person has ID of 0, his name is Will, his age is 33, and he has 385 friends. Given the file, find out the average number of friends by age.

0,Will,33,385

1,Jean-Luc,26,2

2,Hugh,55,221

3,Deanna,40,465

4,Quark,68,21

5,Weyoun,59,318

Homework Answers

Answer #1

Pseudo code:

step1: read the file with read mode

step2: read each line in the file and split with comma(,)

step3: then take 2 and 3 index data make sum and increment cnt

step4: finally age/cnt and number/cnt

step5:finally print the average age and average friends

step6:colse the file

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a code in c++ using linear insertion following the steps below. Comment your work. 1....
Write a code in c++ using linear insertion following the steps below. Comment your work. 1.    Ask the user for the name of a file containing data. If it does not exist, the program should display an error, then ask for a new file name. Entering an asterisk (*) as the first and only character on a line should terminate the program. 2.     You can use a statically-allocated one-dimensional array of doubles for this with length 100. You...
Explain this code function by function in detail int menu() {   int choice;   do {     system("cls");...
Explain this code function by function in detail int menu() {   int choice;   do {     system("cls");     printf("1-Insurence Plan Subscription\n");     printf("2-Claim Processing\n");     printf("3-Accounts Information\n");     printf("4-Searching Functionalities\n");     printf("5-Exit\n");     scanf("%d", &choice);   } while (choice > 5 || choice < 1);   return choice; void subscribe() system("cls");   victims[userCount].id = userCount + 1;   printf("Enter age: ");   scanf("%d", &victims[userCount].age);   printf("\n\n%-25sHealth Insurence Plan\n\n", " ");   printf("-----------------------------------------------------------------------------------------------\n");   printf("|%-30s|%-20s|%-20s|%-20s|\n", " ", "Plan 120(RM)", "Plan 150(RM)", "Plan 200(RM)");   printf("-----------------------------------------------------------------------------------------------\n");   printf("|%-30s|%-20d|%-20d|%-20d|\n", "Monthly Premium", 120, 150, 200);   printf("|%-30s|%-20d|%-20d|%-20d|\n", "Annual Claim Limit", 120000,150000,200000);   printf("|%-30s|%-20d|%-20d|%-20d|\n",...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input operator>> a bigint in the following manner: Read in any number of digits [0-9] until a semi colon ";" is encountered. The number may span over multiple lines. You can assume the input is valid. Overload the operator+ so that it adds two bigint together. Overload the subscript operator[]. It should return the i-th digit, where i is the 10^i position. So the first...
I completed everything except for the last part. I know my answers are right because i...
I completed everything except for the last part. I know my answers are right because i double checked but i just dont know how to answer the last section. Problem 3-1 Schedule C (LO 3.1) Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is located at 678 Third Street, Riverside, CA 92860. Scott’s income statement for the year...
Lance H. and Wanda B. Dean are married and live at 431 Yucca Drive, Santa Fe,...
Lance H. and Wanda B. Dean are married and live at 431 Yucca Drive, Santa Fe, NM 87501. Lance works for the convention bureau of the local Chamber of Commerce, while Wanda is employed part-time as a paralegal for a law firm. During 2016, the Deans had the following receipts: Salaries ($60,000 for Lance, $41,000 for Wanda) $101,000 Interest income—    City of Albuquerque general purpose bonds $1,000    Ford Motor company bonds 1,100    Ally Bank certificate of deposit 400 2,500 Child...
Tax Return Project James A. Varney and Denise M. Varney James and Denise Varney are married...
Tax Return Project James A. Varney and Denise M. Varney James and Denise Varney are married and file a joint return. James is 48 years of age and Denise is 49. James is employed full-time as an electrical engineer for Livingston Unitech Corporation, Ltd. Denise is a self-employed design consultant. They have two children, Pamela and Vernon, who live at home and receive all of their support from their parents. Pamela is 20 years old and attended college on a...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...