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

  Signed-magnitude representation of the similar number

Solution the question below, using the ID to identify the number you wish to specify as the correct answer. Place answer in blank provided.

  Versions of microsoft word

How is this version of Microsoft Word different from earlier versions of Microsoft Word? Be sure to include research AND your opinion.

  Speculate on the role of the cio in a specific industry

q1. with a focus on enterprise hardware software services and human capital list and describe three advantages of green

  Calculates the velocity and momentum of an object

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula for Momentum is m=mass*velocity. Your program should consist of two functions: Passing By Values (..

  Specific design criteria

Give two languages that are in direct conflict with each other. Provide examples of these conflicts as either programming examples (features allowed or not allowed) or program model, (environment). Compare and contrast the terms readability and write..

  Network reference model diagram of the current network

Create a network reference model diagram of the current network that describes the role of each layer for both OSI and TCP/IP that are used to transmit data between the devices and applications specifically in your retail store.

  Explains what an rfc is

Write a 500-word paper that explains what an RFC is, what an Internet Draft is, what organization produces these documents, and the process that is followed to produce these documents.

  The ph of an aqueous solution is a measure

Microsoft Word - HW#9.docx In chemistry, the pH of an aqueous solution is a measure of its acidity. A solution with a pH of 7 is said to be neutral, a solution with a pH greater than 7 is basic, and a solution with a pH less than 7 is acidic.

  State whether each reference is hit or a miss

Assume a cache has 16 1-word blocks and is initially empty. Placement is by direct mapping. Also, state whether each reference is a hit or a miss.

  Independent tester for testing

Scenario: You are an independent tester who is doing the testing at this stage. Assume that the user requirements are...

  Write script readpatwts that will first attempt to open file

Create this data file first. Then, write a script readpatwts that will first attempt to open the file. If the file open is not successful, an error message should be printed.

  The economy is self-regulating

The classical school of economic thought believes that the economy is self-regulating and should be left alone to adjust naturally.  Keynesian's, on the other hand, believe that the economy is inherently unstable and must be managed and planned. Whic..

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