You have been asked to code a solution for the following problem: 1. Read a file that contains the weights of people in pounds. You need to convert the weight from pounds to kilogram and store it in array, then sort the array using a sorting algorithm. Your program should behave like this. [2:48 PM] Input: Text that contains weights of people in pounds. The file: weights.txt Output: depending on the choice of the user • List the content of the file • Sort the content of the file • Search for a number in the file Steps 1. Read the file, convert pounds to kilograms (kilograms = pounds * 0.45359237) and store in an array 2. Display the following menu P. print the file D. display sorted list S. search Q. Quit Take a choice 3. while( the choice is not Q) If choice is P then print the array If choice is D then Sort the array and print the content If choice is S then ask for name and search the array. Display found or not If choice is Q quit the program Take choice

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

You have been asked to code a solution for the following problem:
1. Read a file that contains the weights of people in pounds. You need to convert the weight from pounds to kilogram and store it in array, then sort the array using a sorting algorithm. Your program should behave like this.
[2:48 PM]
Input: Text that contains weights of people in pounds.
The file: weights.txt
Output: depending on the choice of the user
• List the content of the file
• Sort the content of the file
• Search for a number in the file

Steps
1. Read the file, convert pounds to kilograms (kilograms = pounds * 0.45359237) and store in an array
2. Display the following menu
P. print the file
D. display sorted list
S. search
Q. Quit
Take a choice
3. while( the choice is not Q)
If choice is P then print the array
If choice is D then Sort the array and print the content
If choice is S then ask for name and search the array. Display found or not
If choice is Q quit the program
Take choice

The file: weights.txt 23.1332
196.211
121.254
132.277
209.439
182.984
Expert Solution
steps

Step by step

Solved in 4 steps with 9 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY