last element of the array is 7.6 and is at position 7 There is no middle of the array since the array's length is even The largest element of the array is 54.3 and is at position 6 The smallest element of the array is 2.5 and is at position 1 Tip: Divide up the tasks among a few meth

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

The last element of the array is 7.6 and is at position 7 There is no middle of the array since the array's length is even The largest element of the array is 54.3 and is at position 6 The smallest element of the array is 2.5 and is at position 1 Tip: Divide up the tasks among a few methods.

 

 

Instructions
Array Information
The file numbers.txt contains a header value (an int ), followed by that amount of double s. You cannot assume anything else about the file. (When
writing your code in an IDE, you need to create this file. When submitting your solution on Codelab, do not submit numbers.txt .)
In your program, create an array of the appropriate size, populate the array with the double s, and print out various information about the array, as shown
by the following two examples.
Example 1: If numbers.txt contains this:
5 7.3 -6.5 0.5 40 5.2
then the program should produce the following output:
The array {7.3, -6.5, 0.5, 40.0, 5.2) contains 5 elements
The first element of the array is 7.3
The last element of the array is 5.2 and is at position 4
The middle element of the array is 0.5 and is at position 2
The largest element of the array is 40.0 and is at position 3
The smallest element of the array is -6.5 and is at position 1
Example 2: If numbers.txt contains this:
8 12.3 2.5 9.4 3.14 22.15 17 54.3 7.6
then the program should produce the following output:
The array {12.3, 2.5, 9.4, 3.14, 22.15, 17.0, 54.3, 7.6) contains 8 elements
The first element of the array is 12.3
The last element of the array is 7.6 and is at position 7
There is no middle of the array since the array's length is even
The largest element of the array is 54.3 and is at position 6
The smallest element of the array is 2.5 and is at position 1
Tip: Divide up the tasks among a few methods.
Transcribed Image Text:Instructions Array Information The file numbers.txt contains a header value (an int ), followed by that amount of double s. You cannot assume anything else about the file. (When writing your code in an IDE, you need to create this file. When submitting your solution on Codelab, do not submit numbers.txt .) In your program, create an array of the appropriate size, populate the array with the double s, and print out various information about the array, as shown by the following two examples. Example 1: If numbers.txt contains this: 5 7.3 -6.5 0.5 40 5.2 then the program should produce the following output: The array {7.3, -6.5, 0.5, 40.0, 5.2) contains 5 elements The first element of the array is 7.3 The last element of the array is 5.2 and is at position 4 The middle element of the array is 0.5 and is at position 2 The largest element of the array is 40.0 and is at position 3 The smallest element of the array is -6.5 and is at position 1 Example 2: If numbers.txt contains this: 8 12.3 2.5 9.4 3.14 22.15 17 54.3 7.6 then the program should produce the following output: The array {12.3, 2.5, 9.4, 3.14, 22.15, 17.0, 54.3, 7.6) contains 8 elements The first element of the array is 12.3 The last element of the array is 7.6 and is at position 7 There is no middle of the array since the array's length is even The largest element of the array is 54.3 and is at position 6 The smallest element of the array is 2.5 and is at position 1 Tip: Divide up the tasks among a few methods.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 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