In Python, assume that a file containing a series of integers is named numbers.txt and exist on the computer's disk. Write a program that reads the entire numbers store in the file and calculates their total.
Here is what I have written but it does not run:
def. main():
out file=open('numbers.txt','r')
temp=outfile.readline()
total=0
while temp!='':
t=int(temp)
total=total+i
temp=outfile.readline()
outfile.close()
print('Total sum is:',total)
main()
Text file is a file named numbers.txt with the numbers 1-50 in it
Learn more:
- The sum of three consecutive integers is 186. what are the integers
brainly.com/question/1768254
Keywords: python, integers, computer, numbers, program
You did not specified the language, so I did my program in python.
Hope it helps!!!
The pseudocode of the program serves as a prototype of the program
<h3>How to determine the pseudocode?</h3>
The pseudocode of the program is as follows:
- Start
- Declare array MARKS
- Input MARKS[0] to MARKS[9]
- Sort MARKS
- Print MARKS[9] ----- this prints the highest mark
- Print MARKS[0] ----- this prints the least mark
- FOR I = 0 TO 9; ADD MARK[I] TO TOTAL
- Print TOTAL
- Print TOTAL/10
- Stop
The above pseudocode gets input for the array; then sorts the array before performing the required operations
Read more about pseudocodes at:
brainly.com/question/24735155
<u>Answer:</u>
<u>Security is a major concern for organisations.</u>
<u>Explanation:</u>
Developing mobile application for companies is usually centered on security because of the fear of beach of sensitive company information.
For example, a company may need to decide what measures to put in place that can prevent or reduce data breaches. They may either give employees <em>customize devices</em> with already installed mobile applications or provide <em>unique login details</em> to employees to access the Enterprise mobile application on their own phone.