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
stiv31 [10]
3 years ago
13

The following code processes a file containing five positive numbers. What will the variable $result contain after the code is e

xecuted? Be careful! $result = 0; $someFile = fopen("some-file.txt", "r"); for ($count = 1; $count <= 5; $count = $count + 1) { $nextNum = fgets($someFile); } $result = $result + $nextNum; fclose ($someFile); print ("The result is $result ");
Computers and Technology
1 answer:
Tanzania [10]3 years ago
3 0

Answer:

highest of five numbers in the file

Explanation:

  • This code reads the file "some-file.txt" and saves the result in variable "somefile"
  • The runs a for loop for a count of 5.
  • In each loop it compares the current value of the file with the value of the variable result and if the result is true it updates the value of the variable result.
  • At the end of this code the variable result will contain the highest value in the file "some-file.txt" and print it.

You might be interested in
True or False: If you take a course and do not pass it, you still get credit. I feel like it's false but i'm not sure. Can I get
Margaret [11]
Its true because even if you fail a course it shows on your transcript....

8 0
3 years ago
Read 2 more answers
The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? n
djyliett [7]

Answer:

  1. num1=10
  2. num2 =20
  3. num3="30"
  4. sum = num1+num2+num3
  5. print (num1)
  6. print (num2)
  7. print (num3)
  8. print (sum)

The error is at line 3. The variable num3 has been assigned a string value with use of the quotes.

To fix the error, take away the quotes from the number 30, since the arithemetic operation cannot be carried out on the string in python program language.

Explanation:

5 0
3 years ago
Marsha receive an email saying that she won a free cruise to Alaska. What Marsha didn’t realize is that the email was fake and c
Gre4nikov [31]

Answer:

I think the answer is B

Explanation:She sent it to her friends not knowing it would give there computers a virus too.

4 0
3 years ago
Read 2 more answers
Which mathematician is regarded as the first computer programmer?
nataly862011 [7]

Answer:

Ada Lovelace

Explanation:

4 0
3 years ago
What does this mean, i am so confused- Explain the importance of identifying the purpose/use for pre-production documents
irina1246 [14]

Answer: These are mostly used in interior design, fashion design, and advertising. they are often used to generate ideas for a client to meet their approval before making the final product. It can help in terms of planning because it could be used to create a design or a theme.

Explanation: yw

4 0
3 years ago
Other questions:
  • Suppose your name was George Gershwin. Write a complete program that would print your last name, followed by a comma, followed b
    11·2 answers
  • Consider an array of size nine with the numbers in the following order: 40, 60, 20, 80, 70, 90, 30, 10, 50. (a) Create the heap
    7·1 answer
  • Which of the following Python methods in scipy.stats submodule returns the P-value for performing a hypothesis test for the sign
    11·1 answer
  • It's fill the gap homework
    7·1 answer
  • Explain the uses of computer in police department​
    13·2 answers
  • What are some similarity's between NES console and consoles today
    14·2 answers
  • What is the importance of shape in graphic design?​
    5·2 answers
  • Describe the difference between information poor and information rich society?​
    9·1 answer
  • Describe the big data life cycle. Which step do you think is most useful and why?
    14·1 answer
  • Functions are used to reuse the codes number of times in program
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!