Answer:
The following code as follows:
Code:
max=name1; //define variable max that holds name1 variable value.
if (strcmp(name2, max)>0) //if block.
{
max=name2; //assign value to max.
}
if (strcmp(name3,max)>0) //if block.
{
max=name3; //assign value to max.
}
Explanation:
In the above code, we define a variable that is max. The data type of max variable is the same as variables "name1, name2, and name3" that is "char". In the max variable, we assign the value of the name1 variable and use if block statement two times. In if block, we use strcmp() function that can be defined as:
- In first if block we pass two variables in strcmp() function that is "name2 and max" that compare string value. If the name2 variable is greater then max variable value so, the max variable value is change by name2 variable that is "max=name2".
- In second if block we pass two variables in strcmp() function that is "name3 and max" that compare string value. If the name3 variable is greater then max variable value so, the max variable value is change by name3 variable that is "max=name3".
Answer:2. electrical equipment shall be considered readily accessible to those to whom ready access is requisite when it is capable of being reached quickly for operation by using a portable ladder.
Explanation:
Your mom has what is called a Parallel ATA interface. Her computer is very old and I suggest more than just a hard drive :)
Alignment because it will be simple and not complicated and will of course stand out for the person who is looking at the presentation.
Answer:
- with(open("numbers.txt")) as file:
- data = file.readlines()
- runsum = 0
- largest = 0
-
- for x in data:
- if(int(x) > largest):
- largest = int(x)
- runsum += largest
-
- print(runsum)
Explanation:
The solution code is written in Python 3.
Firstly, open a filestream for numbers.txt (Line 1) and then use readlines method to get every row of data from the text files (Line 2).
Create a variable runsum to hold the running sum of number bigger than the maximum value read up to that iteration in a for loop (Line 3).
Use a for loop to traverse through the read data and then check if the current row of integer is bigger than the maximum value up to that point, set the current integer to largest variable and then add the largest to runsum (Line 6 - 9).
At last display the runsum to console terminal (Line 11).