Answer:
def average_strings(lst):
total_length = 0
avg = 0
for s in lst:
total_length += len(s)
avg = total_length/len(lst)
return avg
Explanation:
Create a function called average_strings that takes one parameter, lst
Initialize the total length and avg variables
Create a for loop that iterates through the lst. Get each string's length and put it to the total length
When the loop is done, calculate the average, divide total length by length of the lst
Return the average
Answer:
right clicking on the desktop and selecting "view"
Explanation:
Some of the methods for opening Microsoft Word software include;
using the Ms. Word icon on the task-bar
searching for the Ms. Word program if you are using the Widows operating system
using the Ms. Word icon on the desktop
On the other hand, right clicking on the desktop and selecting "view" is a procedure for changing icon settings on desktop,
Answer:
Windows Server operating systems are a popular choice for a network because they use wizards and setup devices as the user operating system, making it easier to set up network features work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX
Explanation:
Windows operating system is popular than any other operating system for certain reasons:
1. It provides GUI feature which any layman can access and learn easily
2. The compatibility that it provides makes it more popular
3. It supports most of the software program available in the market
4. The design of Windows is more comfortable when compared to other open source operating system.
Only thing is that it is not a free-ware. Licence needs to be purchased to use it.
Answer:
Hi, I'm going to put the code answer here and you put in the corresponding line to not copy all the code in the answer.
replace the following line or adjust to the following code
/*
* CODE HERE
while(personSelect <= 0 || personSelect > 5) {
System.out.println("Wrong number, try to input the number in range 1 to 5" );
personSelect = scan.nextInt();
}
if(personSelect == 1){
person1.setGpa(newGPA);
printInfo()
}
else if(personSelect == 2){
person2.setGpa(newGPA);
printInfo()
}
else if(personSelect == 3){
person3.setGpa(newGPA);
printInfo()
}
else if(personSelect == 4){
person4.setGpa(newGPA);
printInfo()
}
else {
person5.setGpa(newGPA);
printInfo()
}
*/
Explanation:
According to the description of code, we have to add some lines to resolve the questions.
a):
In base on the input, we have to modify the <em>attribute GPA</em> with the method <em>setGpa</em> depending on the person chosing. We call the person chosen before and also call the method setGpa( ) and pass as <em>parameter</em> the GPA value obtained in tha last input
b)
In this case we have to <em>create a loop</em> for iterate the times that is necesary to get a value of person that is permit in <em>range 1 to 5</em>, and hence that we create and individual if condition to assign the GPA to the person chosen.
I hope it's help you.