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
Class 00 rubber gloves are used when working with voltages less than​ _____.
Radda [10]
Answer: 500 volts AC, 750 volts DC
Class 00 rubber gloves are given the color "beige" based on the color code of rubber gloves.
The proof test voltage for this class of rubber gloves is 2500 volts of AC voltage and 10000 volts of DC voltage
4 0
2 years ago
To rearrange the data on your hard disk so your computer can run more efficiently, you use ____.
Ratling [72]
A disk optimization program, but they're probably looking for defragmenting program.
5 0
3 years ago
C++
Cerrena [4.2K]

Answer:

#include <iostream>

#include<iomanip>

using namespace std;

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)

{

  double dollarCost = 0;

  dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;

  return dollarCost;

}

int main()

{

  double miles = 0;

  double dollars = 0;

  cout << "Enter miles per Gallon   : ";

  cin >> miles;

  cout << "Enter dollars per Gallon: ";

  cin >> dollars;

  cout << fixed << setprecision(2);

  cout << endl;

  cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;

  cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;

  cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;

  return 0;

}

Explanation:

  • Create a method definition of DrivingCost that accepts  three input double data type parameters drivenMiles,  milesPerGallon, and dollarsPerGallon and returns  the dollar cost to drive those miles .
  • Calculate total dollar cost and store in the variable, dollarCost .
  • Prompt and read the miles and dollars per gallon  as input from the user .
  • Call the DrivingCost function three times  for the output to the gas cost for 10 miles,  50 miles, and 400 miles.

 

4 0
2 years ago
Read 2 more answers
PLS HELP MEE!!!
kramer

Answer:

starting with lowercase letters, using uppercase letters for the first letter in a new word

Explanation:

starting with a dollar sign, using lowercase for the remaining parts of each word

4 0
2 years ago
Tools used to build a bridge<br>​
Sati [7]

Aerial Lifts,

Vertical Masts and Hydro Platforms,

Telehandlers,

Excavators,

Skid Loaders,

Backhoes,

Cranes,

Air Compressors.

If It was helpful, can you make me brainliest please?

6 0
2 years ago
Other questions:
  • The technology (software) that automatically downloads website information to your computer is called ________.'
    15·1 answer
  • : How does the founder of Wikipedia keep a tight reign on accuracy? HELP PLEZ AT LEAST A PARGRAPH PLES
    6·1 answer
  • A network technician is asked to redesign an Ethernet network before some new monitoring software is added to each workstation o
    7·1 answer
  • What is the output of the code snippet given below?string s = "abcde";int i = 1;while (i &lt; 5){ cout &lt;&lt; s.substr (i, 1);
    11·1 answer
  • Precautionary measures to be observed when using ICT tools​
    15·1 answer
  • What is not a benefit of exploring tabs and groups in Microsoft Word?
    9·2 answers
  • Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers s
    14·1 answer
  • which program monitors the computer by looking for known trouble makers as well as suspicious behavior​
    11·1 answer
  • Task 2: Typing a School Speech
    12·1 answer
  • Which of the following statements is NOT
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!