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
VladimirAG [237]
2 years ago
13

Write an application that allows a user to enter a filename and an integer representing a file position. Assume that the file is

in the same folder as your executing program. Access the requested position within the file, and display the next 10 characters there.
Computers and Technology
1 answer:
hodyreva [135]2 years ago
8 0

The program is an illustration of file manipulations, where files are accessed, read and modified

<h3>The main program</h3>

The program written in Python, where comments are used to explain each action is as follows;

#This gets the file name

fname = input("Enter file name: ")

#This gets an integer value

num = int(input("Integer: "))

#This opens the file

file = open(fname, 'r')

#This initializes the number of characters to 0

count = 0

#This begins an iteration

while 1:

# This prints each character

print(file.read(1))

#This increases the number of characters printed by 1

count+=1

#When 10 characters are printed

if count == 10:

    #This closes the iteration

 break

#This closes the file

file.close()

Read more about file manipulations at:

brainly.com/question/16397886

You might be interested in
A manufacturer of machine tools creates a spreadsheet of tools and the cost for those. The spreadsheet has four fields: name of
iragen [17]

The question above has multiple answers:


<span>1.       </span>Sort the data in the field "name of the tool" in ascending order alphabetically.

<span>2.       </span> Sort the data in the field “number of tools” in ascending order.

<span>3.       </span>Sort the data in ascending order of cost per tool.

<span>4.       </span>Sort the data in ascending order of total cost.

The answer is 3. Sort the data in ascending order of cost per tool


You can always make your spreadsheet work a bit more organized by sorting your data. In this case, what is required from the manufacturer of the tools is to sort the data so that someone else is able to find out which tool costs the most. Basically, the price of the tool which is the highest is required to be known. Therefore, the manufacturer of the tools should Sort the data in ascending order of cost per tool.






3 0
3 years ago
Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
NISA [10]
<span>1.editing the image file in a dedicated photo editing program before inserting it
Hope this reaches you before net neutrality sets in</span>
4 0
3 years ago
Read 2 more answers
How does a spreadsheet affect a column of numerals when it sorts the column
maria [59]

Explanation/Answer:

Data can be put into more than one cell (Excel), which should be an important key to your answer. In SEVERAL CELLS AT THE SAME TIME or more. The data can be entered in dates, text, times, or numbers. Formatting the data can be done in a possibility of ways.

6 0
3 years ago
Read 2 more answers
Please describe the role of games in modern society!
ohaa [14]
It is to Entertainment.
5 0
2 years ago
Read 2 more answers
What's your opinion on Pokemon​ and pixeldip
faust18 [17]

Answer:

Its a good game but an amazing show. 10/10

Explanation:

7 0
2 years ago
Other questions:
  • If you are feeling fatigued or sleepy while driving _________________.
    13·2 answers
  • Which items may interfere with a wireless connection and may cause disruptions or delays in submitting assignments in blackboard
    9·2 answers
  • What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
    10·1 answer
  • Which button will allow you to insert quotes and notes into text into a document​
    12·1 answer
  • __________________ ensures that each row is uniquely identified by the primary key, which means that a proper search for an exis
    10·1 answer
  • When the Squirrel peer-to-peer web caching service was evaluated by simulation, 4.11 hops were required on average to route a re
    11·1 answer
  • When an item in a menu is black, it means that _____.
    6·2 answers
  • A computer is performing a binary search on the sorted list of 7 numbers below. What is the maximum number of iterations needed
    15·1 answer
  • I'm having trouble with an assignment of mine. I'm making a text based adventure game for extra credit in my class and I'm stuck
    12·1 answer
  • Simple Java programming
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!