(XY.txt) file is 7.2830 84.40 9.1327124.02 7.2619133.16 6.2527 43.96 4.2160 24.08 ...
Fantastic news! We've Found the answer you've been seeking!
Question:
(XY.txt) file is
7.2830 84.40
9.1327124.02
7.2619133.16
6.2527 43.96
4.2160 24.08
5.2724 57.80
5.2025 73.89
-9.9500 80.53
0.2790-12.43
2.2115 3.37
3.1222 13.63
16.2413223.01
-4.2026 33.78
-7.1914 42.89
4.1417 53.42
6.1714 61.66
9.2516 73.68
15.2419383.66
6.2715 93.53
-3.2016 3.46
12.2013213.63
3.1824 23.85
Transcribed Image Text:
Write a program that will read in a data file (XY.txt) and create a new data file. The input data file will consist of two columns of numbers. Each line in the file will have two values. The program will multiply the values on each line to create a third value, and store this triplet of values in the output file. The output file should then consist of three columns of numbers. Input File Output File 7.2830 84.40 9.1327 124.02 7.2619 133.16 6.2527 43.96 4.2160 24.08 5.2724 57.80 5.2025 73.89 -9.9500 80.53 0.2790 -12.43 2.2115 7.2830 84.40 9.1327 124.02 7.2619 133.16 6.2527 43.96 4.2160 24.08 5.2724 57.80 5.2025 73.89 -9.9500 80.53 0.2790 -12.43 2.2115 3.37 3.37 614.685 1132.637 966.995 274.869 101.521 304.745 384.413 -801.274 -3.468 7.453 To make the program flexible, the user should be prompted to enter the name of the input file, and the output file. The output file should be formatted so that the columns line up, each with the number of decimal places shown above. In addition, the program should display on the screen the number of lines in the file, and the sums of each of the columns. Write a program that will read in a data file (XY.txt) and create a new data file. The input data file will consist of two columns of numbers. Each line in the file will have two values. The program will multiply the values on each line to create a third value, and store this triplet of values in the output file. The output file should then consist of three columns of numbers. Input File Output File 7.2830 84.40 9.1327 124.02 7.2619 133.16 6.2527 43.96 4.2160 24.08 5.2724 57.80 5.2025 73.89 -9.9500 80.53 0.2790 -12.43 2.2115 7.2830 84.40 9.1327 124.02 7.2619 133.16 6.2527 43.96 4.2160 24.08 5.2724 57.80 5.2025 73.89 -9.9500 80.53 0.2790 -12.43 2.2115 3.37 3.37 614.685 1132.637 966.995 274.869 101.521 304.745 384.413 -801.274 -3.468 7.453 To make the program flexible, the user should be prompted to enter the name of the input file, and the output file. The output file should be formatted so that the columns line up, each with the number of decimal places shown above. In addition, the program should display on the screen the number of lines in the file, and the sums of each of the columns.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that reads an input data file multiplies the values on each line to create a ... View the full answer
Related Book For
Managerial Accounting
ISBN: 978-1259307416
16th edition
Authors: Ray Garrison, Eric Noreen, Peter Brewer
Posted Date:
Students also viewed these programming questions
-
27. A parallel plate capacitor is charged and the charging battery is then disconnected. If the plates of the capacitor are moved farther apart by means of insulating handles :- (1) the charge on the...
-
A researcher wanted to find out if there was difference between older movie goers and younger movie goers with respect to their estimates of a successful actors income. The researcher first...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
From the information below, 1. List of the working capital accounts. 2. Calculate the net working capital. Buildings $100,000 Cash ... 5,000 Trade receivables ... 25,000 Trade and other payables .....
-
A 1.00-mol sample of air (a diatomic ideal gas) at 300 K, confined in a cylinder under a heavy piston, occupies a volume of 5.00 L. Determine the final volume of the gas after 4.40 kJ of energy is...
-
Declan Ross wants to sell his business. The firm has no debt and earns an 8% return (ROE) on equity of $150,000. The business can borrow at an after tax rate of 5%. A consultant has advised that the...
-
Consider ethyl-tertiary-butyl-ether (ETBE) as an alternative gasoline oxygenate to MTBE. Although the latter appears to have the best combination of properties such as oxygen content, octane number,...
-
The following questions illustrate nonannual compounding. a) One hundred dollars is placed in an account that pays 12 percent. How much will be in the account after one year if interest is compounded...
-
Anderson Corporation has found that 80% of its sales in any given month are credit sales, while the remainder are cash sales. Of the credit sales, Anderson Corporation has experienced the following...
-
Q1. The structure shown consists of a S18 x 70 rolled-steel beam AB and two short members welded together and to the beam. (a) Draw the shear and bending-moment diagrams for the beam and the given...
-
1. Show that the equation v=v+2ax is dimensionally correct, where v and vo represent velocities, a is acceleration, and x is a distance. 2. A person makes a trip by a car between two cities. A record...
-
Balance the following equations 1. CO2 + H2O C6 H12 O6 + O2 2. SiCl4+ H2 O H 4SiO4 + HCl 3. Al + HCl AlCl3 + H2 4. Na 2CO3 + HCl NaCl + H 2O + CO2 5. C 7H 6O2+ O2 CO2 + H 2O 6. Fe2(SO4)3 + KOH ...
-
Bill took out a 10 year loan to buy a car. If the loan carried an annual interest rate of 5.2% and he made monthly payments of $345, how much interest did he pay? Round your answer to the nearest...
-
4. Verify that f(x)=-3+2x and g(x)=3 x-1 2 the functions are inverses of each other. (3 pts)
-
ABC Limited has a net income of $40,000,000 and a profit margin of 10%. Total asset turnover is 25% and the current ratio is 3, while the amount of current liabilities is $72,000,000. Calculate the...
-
Consider the below printed, incomplete Python 3 program to perform clustering on a list of two-dimensional points, given initial centroids. # Call this function to update the centroid of a cluster...
-
Esc Which of the following statements is false about epithelial tissue? Epithelial cells are typically arranged in layers. Epithelial cells do not secrete a round substance. 4 Epithelial cells can be...
-
Nitrogen monoxide reacts with hydrogen as follows: 2NO(g)+ H2(g) N2O(g) + H2O(g) The rate law is [H2]/ t = k[NO]2[H2], where k is 1.10 107 L2/(mol2s) at 826oC. A vessel contains NO and H2 at...
-
National Restaurant Supply, Inc., sells restaurant equipment and supplies throughout most of the United States. Management is considering adding a machine that makes sorbet to its line of ice cream...
-
Refer to the financial statement data for Lydex Company given in Problem 1614. Required: For both this year and last year: 1. Present the balance sheet in common-size format. 2. Present the income...
-
Weller Company's budgeted unit sales for the upcoming fiscal year are provided below: The company's variable selling and administrative expense per unit is $2.50. Fixed selling and administrative...
-
What is the pressure drop associated with water at \(27^{\circ} \mathrm{C}\) flowing with a mean velocity of \(0.1 \mathrm{~m} / \mathrm{s}\) through an \(800-\mathrm{m}-\) long cast iron pipe of...
-
Fully developed conditions are known to exist for water flowing through a \(50-\mathrm{mm}\)-diameter tube at \(0.02 \mathrm{~kg} / \mathrm{s}\) and \(27^{\circ} \mathrm{C}\). What is the maximum...
-
Water at \(35^{\circ} \mathrm{C}\) is pumped through a horizontal, \(200-\mathrm{m}\)-long, \(30-\mathrm{mm}\)-diameter tube at \(0.25 \mathrm{~kg} / \mathrm{s}\). Over time, a 2-mm-thick layer of...
Study smarter with the SolutionInn App