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
30 mins and I will give Brianlest what is the difference between a method and a function in which ways are they similar why do y
omeli [17]

Answer:

For 1), you should also add that methods in C++ are called member functions. Thus, the difference between functions and methods in this context is analogous to the difference between functions and member functions in C++. Furthermore, languages like Java only have methods. In this case, functions would be analogous to static methods and methods would have the same meaning. For 2), you should add that a method is able to operate on the private instance (member) data declared as part of the class. Any code can access public instance data.   A function is a mathematical construct. I would say all methods are functions but not all functions are methods

Explanation:

8 0
3 years ago
what is a paragraph on what i can write on what i learned from watching basic keyboard shortcuts using control functions video
finlep [7]

Answer:

Write the following nonsensical paragraph:

Explanation:

I learned how to navigate the computer efficiently. I learned how to use Ctrl + (key) to quickly do (something). ( Now reword that multiple times with different commands. ) Now I can harness my inner laziness to browse the computer at a faster speed.

6 0
3 years ago
Write a function square_evens(values) that takes a list of integers called values, and that modifies the list so that all of its
Mice21 [21]

Answer:

#create the function

def square_evens(values):

   count_Value = 0

   #loop loop for iteration

   for i in values:

       #check for even number

       if (i) % 2 == 0:

           values[count_Value] = i * i  #store the square in the same index

       count_Value =count_Value + 1

   print(values)  #print the list

# list of integers

values = [1, 2, 3, 4, 5, 6]

#calling the function

square_evens(values)

Explanation:

The above code is written in python. first, create the function square_evens() which takes one parameter of the list.

inside the function declare the variable and then take a for loop for traversing each element in the list. Inside the for loop, we take the if-else statement for checking the number is even. if the number is even then stored the square of that value in the same list. To store the square value in the same index, we take the count variable for tracking the index.

After the all element in the list checked, the program terminates the loop and then print the updated list on the screen.

Outside the function, create the list with an integer value and then calling the function with passing the list argument.  

NOTE: In the python programming, please keep the indentation in code.

5 0
3 years ago
Write code that outputs variable numDays as follows. End with a newline. If input is 3, output is: Days: 3
kobusy [5.1K]

Answer:

In C++:

#include<iostream>

using namespace std;

int main(){

int numDays;

cin>>numDays;

cout<<"Days: "<<numDays<<endl;

return 0;

}

Explanation:

This line declares numDays as integer

int numDays;

This line gets user input for numDays

cin>>numDays;

This line prints the required output and ends with a newline

cout<<"Days: "<<numDays<<endl;

8 0
3 years ago
What is a task that an internet database allows you to perform? storing your software backing up your files sorting information
lakkis [162]
Answer : Sorting information based on certain criteria.
4 0
3 years ago
Read 2 more answers
Other questions:
  • In two to three paragraphs, come up with a way that you could incorporate the most technologically advanced gaming into your onl
    10·1 answer
  • The waterfall model and spiral model are variations of SDLC. Do some research to find out what they are and explain how these mo
    14·1 answer
  • The greatest common divisor of integers x and y is the largest integer that evenly divides into both x and y. Write a recursive
    7·1 answer
  • 24 ________ are graphical represenattaion of distribution of data. a) bar graph b) pie charts c) histogram d) frequency chart
    15·1 answer
  • Describe any five GSM PLMN basic services?
    10·1 answer
  • Who do you guys ship lol bit with?
    14·2 answers
  • Marco travels often and does not have consistent wireless Internet service. He frequently uses his mobile phone service to provi
    14·2 answers
  • For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
    7·2 answers
  • If you double the force of and object what happens to the acceleration
    10·1 answer
  • What are the features of the title bar for the Microsoft word application?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!