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

  Heptadeca class that encapsulates a heptadeca number

Write a Heptadeca class that encapsulates a Heptadeca number value. A Heptadeca number is one with 17 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G. The methods the class has are: public void read(), public void set(String), public voi..

  Show schematically a function definition line

Show schematically a function definition line ? And how u would call (execute) the function in a MATLAB program?

  The purpose of the term project to explore it topic

The purpose of the term project is for you to explore an IT topic of your choice. You may choose any IT topic, subject to instructor's approval.

  Benefits-negative effects brought by workplace automation

Write down at least three benefits and three negative effects brought about by workplace automation.

  Generate the intermediate code

Generate the intermediate code for the following expression assuming the usual rules concerning parentheses, precedence and associativity. Be sure to reuse temporaries as soon as possible: x + (5 - y) * z - 1

  Steps to follow to get evidence in investigating files

Drive that you are investigating comprises several password-protected files and other files with headers which do not match extension. What procedures would you require to follow to retrieve evidence?

  Identify potential opponents of the project in the authors

Critically read your assigned project as soon as it appears in ST. If you do not understand any issue or argument ation, do not hesitate to ask its authors for their explanation. Post your question in ST.

  Use the smallest possible array to solve this problem

Use the smallest possible array to solve this problem. Display the complete set of unique value input after the user inputs each new value.

  Identify the security advantages of cloud-based solutions

A.Identify the security advantages of cloud-based solutions. B.Identify the security disadvantages if cloud-based solutions.

  Describe examples of the three types of cost estimates

Describe and present real world examples of the three types of cost estimates and where you would find them in the context of the PMBOK® process groups. Describe who would serve as your audience when presenting these estimates

  Determine enterprisesystem possible without virtuaalization

determine whether or not you believe that enterprise systems would have been possible without virtualization. Provide at least three reasons to support your position.

  Determine slas are necessary and identify monitoring points

Determine if internal service-level agreements (SLAs) are necessary, and identify the monitoring points and levels for an SLA

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