signment 8. Student -324  234.428,

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

Assignment 8.

Student -324  234.428, 

 

On the page for this assignment is a datafile values. txt whose contents are as
follows.
Studenti -324 234. 428 8.936e15
TAI 5273 -7394.57 64..
Student2 -34 57.864 -3.71e06
For this problem, you read this file and (from the data in the file) produce the following table,
Name I Measure 1 | Measure 2 | Measure 3
-324 I 234. 4281 8.936e+15
+5273 | -7394.570 i 64.815
57.864 I -3710000
Studenti |
TAI
Student2 1
-34 I
This is mostly an exercise in formatting. Have a fixed minimum field width for cach field (column).
The first column is string type, the second is integer with a sign for both positive and negative
numbers, the third column is floating point with a precision (number of digits after the decimal
point) of three, and the last column is general (g') with a precision (here the maximum number of
digits before and after the decimal point) of seven. (See the informal on the giG format type below.)
Use the split () string method to isolate the fields in an input line, and use int () and float ()
to convert string values to integers or floating-point numbers, respectively.
Format type g/G
The format type g has the form m. pg, where mis the minimum field width and p is the precision.
Here, unlike with £, the precision is the number of digits after and before the decimal point. If the
integral part cannot all be represented because the precision is too small, we get exponential
notation eg.
>>> "(0:.4g)".format (12345.67)
1.235e+04
If the precision is large enough so that all the integral part can be represented, we get floating-
point notation e.g.,
» "(0:.5g)".format (12345.67)
"12346
>> "(0:.6g)".format (12345.67)
"12345.7
As with the eE format type, when g/G results in exponential notation, the exponent is introduced
with an 'e' if g is used, and with an 'E' is G is used eg.
>>> "(0:.4G)". format (12345.67)
'1.235E+04
Transcribed Image Text:On the page for this assignment is a datafile values. txt whose contents are as follows. Studenti -324 234. 428 8.936e15 TAI 5273 -7394.57 64.. Student2 -34 57.864 -3.71e06 For this problem, you read this file and (from the data in the file) produce the following table, Name I Measure 1 | Measure 2 | Measure 3 -324 I 234. 4281 8.936e+15 +5273 | -7394.570 i 64.815 57.864 I -3710000 Studenti | TAI Student2 1 -34 I This is mostly an exercise in formatting. Have a fixed minimum field width for cach field (column). The first column is string type, the second is integer with a sign for both positive and negative numbers, the third column is floating point with a precision (number of digits after the decimal point) of three, and the last column is general (g') with a precision (here the maximum number of digits before and after the decimal point) of seven. (See the informal on the giG format type below.) Use the split () string method to isolate the fields in an input line, and use int () and float () to convert string values to integers or floating-point numbers, respectively. Format type g/G The format type g has the form m. pg, where mis the minimum field width and p is the precision. Here, unlike with £, the precision is the number of digits after and before the decimal point. If the integral part cannot all be represented because the precision is too small, we get exponential notation eg. >>> "(0:.4g)".format (12345.67) 1.235e+04 If the precision is large enough so that all the integral part can be represented, we get floating- point notation e.g., » "(0:.5g)".format (12345.67) "12346 >> "(0:.6g)".format (12345.67) "12345.7 As with the eE format type, when g/G results in exponential notation, the exponent is introduced with an 'e' if g is used, and with an 'E' is G is used eg. >>> "(0:.4G)". format (12345.67) '1.235E+04
Expert 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