1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuri [45]
3 years ago
7

Write code that does the following: opens an output file with the filename numbers.txt , uses a loop to write the numbers 1 thro

ugh 100 to the file, and then closes the file.
Computers and Technology
2 answers:
kirza4 [7]3 years ago
4 0

Answer:

numbersFile=open("numbers.txt","w")

for i in range(1,101):

   

   numbersFile.write("%s\n" % i)

numbersFile.close()

Explanation:

The programming language used here is python,.

The first line opens a file numbers.txt in the write mode (w), which means you can add new lines of text to the file.

In the second line, the range function is used with a FOR loop to generate a range of numbers from 1 through 100.

In the third line, the program adds all the numbers generated by the range and FOR loop to the txt file, and finally the file is closed.

otez555 [7]3 years ago
3 0
#include <iostream> #<span>include <fstream> </span>using<span> namespace std; int main( int argc, ... </span>outputFile.open( "<span>primeNumbers.txt" ); //

Maybe this will help :)</span>
You might be interested in
Home communication involves controlling systems such as heating, cooling, and security.
katen-ka-za [31]

Answer:

<em>A. True</em>

Explanation:

<em>Home communications involves automating home. It includes controlling the air-con,water heater, webcam, etc. A</em>

6 0
3 years ago
Determine the number of bytes necessary to store an uncompressed RGB color image of size 640 × 480 pixels using 8, 10, 12 and 14
dexar [7]

Answer:

For 8 bits / Color Channel: 921, 600 bytes.

For 10 bits / Color Channel: 1,152,000 bytes.

For 12 bits / Color Channel: 1,382,400 bytes.

For 14 bits / Color Channel : 1,612, 800 bytes.

Explanation:

Un uncompressed RGB color image of 640 pixels wide by 480 pixels height (VGA resolution) uses 3 samples of x bits fin order to represent the quantity of each primary color (red, green and blue) in a given pixel of the image.

So, if we use 8 bits/ sample, we can calculate the bytes needed to store a complete image as follows:

640*480*3*8 bits = 7, 372,800 bits. (1)

As, by definition, 1 byte= 8 bits, we have:

Nº of bytes = 7,372,800 / 8 = 921,600 bytes. (2)

In order to get the bytes needed to store the same image, using 10, 12 and 14 bits/ sample, all we need is replacing 8 by 10, 12 and 14 in (1), and then dividing by 8 as in (2).

Proceeding in this way we obtain:

640*480*3*10 = 9,216,000 bits ⇒    1,152,000 bytes.

640*480*3*12 = 11,059,200 bits ⇒   1,382,400 bytes.

640*480*3*14=   12,902,400 bits ⇒  1,612,800 bytes.

8 0
3 years ago
Know when the double, int, String, and char data types are best used. Example: I would store a social security number in a strin
lidiya [134]
A double is best used for numbers that are real, as in they have a decimal. Int is best used for numbers that are whole, as in no decimal. Strings are best used, as in the example you gave, when you have to represent a piece of information that isn’t strictly numbers
4 0
3 years ago
In a word processor, Tariq chooses Options from the Tools menu and then selects the Track Changes tab. Which of the following ta
bearhunter [10]

Highlight Changes

Compare Documents

3 0
3 years ago
PLEASEEEEE HELLPPP IT'S URGENT!!! PLEASEEEEE HELLPPP IT'S URGENT!!!
kogti [31]

Answer:

LED matrix is a grid of lights arranged into rows and columns

A battery is a device consisting of one or more electrochemical cells with external connections for powering electrical devices such as flashlights, mobile phones, and electric cars.

A processor is a machine that processes something.

An accelerometer is a tool that measures proper acceleration.

Universal Serial Bus is an industry standard that establishes specifications for cables and connectors and protocols for connection, communication and power

A compas is an instrument containing a magnetized pointer which shows the direction of magnetic north and bearings from it.

A block editor allows you to add Columns block, which basically adds two columns of paragraph blocks.

Iteration is the repetition of a process in order to generate an outcome.

Selection is the action or fact of carefully choosing someone or something as being the best or most suitable.

Algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

debug identifies and remove errors from (computer hardware or software).

an arithmetical value, expressed by a word, symbol, or figure, representing a particular quantity and used in counting and making calculations and for showing order in a series or for identification.

I can do the rest if you want, just wanted to give you a head start :)

8 0
3 years ago
Other questions:
  • You're creating a table for one of your slides, and need to make some modifications to your table structure. Which of the follow
    14·1 answer
  • What are three reasons teens might start drinking alcohol??
    7·2 answers
  • 1. What is Java SE?
    11·2 answers
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
  • What is the purpose of the "time-to-live" (TTL) field of the IPv4 packet? a. ensures that the packet remains in the network long
    6·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    8·1 answer
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
  • Select the correct answer.
    8·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!