Asldfjasjdkflajfasjdf;laksjdf;kljas
- After teaching a group of students about drug measurement and calculation systems, the instructor determines that teaching is successful when students can identify which metric system is the most widely used system.
- The metric system is a measurement system for something that is done in a study and calculation. An example of a metric system is the meter used to measure length, grams to measure weight, milliliters to measure volume.
- In this case, we can take an example from the application of the metric system in the world of health. A nurse uses the metric system to calculate doses and uses the liter as the base unit for measuring fluids.
Learn more about Metric System here brainly.com/question/1764307
#SPJ1
Answer:
The method written in Java is as follows:
public static ArrayList<Double> removeHighPrice (ArrayList<Double> prices){
for(int i =0;i<prices.size();i++){
if(prices.get(i) > 5.00){
prices.remove(i);
break;
}
}
return(prices);
}
Explanation:
This line declares the method
public static ArrayList<Double> removeHighPrice (ArrayList<Double> prices){
This line iterates through the ArrayList named prices
for(int i =0;i<prices.size();i++){
This checks if current price is greater than 5
if(prices.get(i) > 5.00){
If yes, the price is removed
prices.remove(i);
And the loop is terminated
break;
}
}
This returns the ArrayList
return(prices);
}
<em>I've added as an attachment, the complete program which includes the main method</em>
Answer:
#section 1
def maxTemp(filename):
import pathlib
f = pathlib.Path(filename)
f.exists()
if f.exists():
f = open(filename, "r")
#section 2
next(f)
res = [int(sub.split(',')[1]) for sub in f]
maxdata = (res[0])
for i in range(len(res)-1):
if maxdata < res[i]:
maxdata = res[i]
index = res.index(maxdata)
f.close()
#section 3
li = []
a = open(filename, "r")
for line in a:
line = line.strip()
li.append(line)
a.close()
return (li[index+1])
else:
return -1
print(maxTemp("new.csv"))
Explanation:
#section 1:
The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.
#section 2:
We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.
<em>res = [int(sub.split(',')[1]) for sub in f]
</em>
The maximum number is gotten by using the if statement to compare all elements in the list. The index of the maximum item in the list is collected.
the file is then closed.
#section 3 :
The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.