Contains an unknown number of lines

Assignment Help Basic Computer Science
Reference no: EM13878622

A file named data.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates two files, dataplus.txt and dataminus.txt, and copies all the lines of data1.txt that have positive integers to dataplus.txt, and all the lines of data1.txt that have negative integers to dataminus.txt. Zeros are not copied anywhere.

Use the file object output to write the string "3.14159" to a file called pi.

Assume that a file containing a series of integers is named numbers.txt. Write a program that calculates the average of all the numbers stored in the file. 

Reference no: EM13878622

Questions Cloud

Can be useful in strengthening internal controls : Discuss how these practices can be useful in strengthening internal controls.
Personal auto policy that provides the coverages : George has a personal auto policy that provides the following coverage’s:liability coverage $150,000/$300,000/$50,000, $5,000 medical payments coverage, $25,000/$50,000 uninsured motorists coverage, $400 deductible for a collision loss, and a $50 ded..
The contemporaneous utilization of the english language : "The contemporaneous utilization of the English language has undergone tremendous changes"with the example of word "Vanity".
Why does a company need to be concerned : Why does a company need to be concerned with controlling access to its records?
Contains an unknown number of lines : A file named data.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates two files, dataplus.txt and dataminus.txt, and copies all the lines of data1.txt that have positive integers to dataplus.txt,..
Why is a policies and procedures manual considered : Why is a policies and procedures manual considered an element of internal control?
Compute the present value of these dividends : Fresno Corp. is a fast-growing company that expects to grow at a rate of 25 percent over the next two years and then to slow to a growth rate of 17 percent for the following three years. If the last dividend paid by the company was $2.15. What is the..
Name and distinguish among the three types of internal : Name and distinguish among the three types of internal controls.
Dividend growth rate-what will share of stock sell for today : Storico Co. just paid a dividend of $2.00 per share. The company will increase its dividend by 20 percent next year and will then reduce its dividend growth rate by 5 percentage points per year until it reaches the industry average of 5 percent divid..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd