Answer:
Explanation:
The following code is written in Java, the function takes in a list with the previous day's values. The function then uses that list, loops through it and multiplies each individual value by 2 and returns the modified list. The first red square represents the test case for the function, while the second red square in the image represents the output.
public static ArrayList<Integer> doubleIt(ArrayList<Integer> mylist) {
for (int x = 0; x<mylist.size(); x++) {
mylist.set(x, mylist.get(x)*2);
}
return mylist;
}
Answer:
Sorted array will be:-
3 5 5 9
Explanation:
In Selection Sort algorithm it sorts the array by repeatedly finds the minimum in the array form the array that is unsorted and swaps it with the value at the first position.
The unsorted array:- 5 3 9 5
In first iteration
minimum is 3.
3 will be swapped with 5.
Now the array is 3 5 9 5
sorted array 3
In second iteration
unsorted array is 5 9 5
sorted array 3 5
and the minimum from it is 5
No swapping will occur.
In third iteration
unsorted array is 9 5
minimum is 5
sorted array 3 5 5
swap it with 9.
Now the array is sorted.
3 5 5 9
The 3 files you need to have for a successful mail merge are:
- An Excel spreadsheet works
- Outlook Contact List.
- Apple Contacts List or Text file, etc.
<h3>What is Mail Merge?</h3>
This is known to be the act of carrying out a Mail Merge and it is one where a person will need to use a Word document and a recipient list, that is an Excel workbook.
Files needed are:
- Text file,
- address files, etc.
The 3 files you need to have for a successful mail merge are:
An Excel spreadsheet worksOutlook Contact List.
Apple Contacts List or Text file, etc.
Learn more about mail merge from
brainly.com/question/20904639
#SPJ1
Answer is C
Braine list please:)
Answer:
def getChar():
while True:
in1 = input('Enter first char: ')
try:
if len(in1) != 1:
raise
else:
in2 = input('Enter second char: ')
if len(in2) != 1:
raise
else:
break
except:
print('Enter just one character')
return in1, in2
def chars2string(in1,in2):
print(in1*5 + in2*5)
def main():
ls = getChar()
in1 = ls[0]
in2 = ls[1]
chars2string(in1, in2)
if __name__ == '__main__':
main()
Explanation:
The programming language used is python 3.
The script first defines a function getChar and makes use of a while loop in combination with try and except blocks and IF statements, the code ensures that both inputs that are entered by the user after the prompt are 1 in length. i.e. Just one character. This function returns the two characters that were entered.
The second function that is defined is chars2string this function takes two arguments, It repeats each argument five times and returns a joined string.
Finally, the main function is defined and it calls the getChar function first, the values that are returned by this function is assigned to two variables, that is then passed on to the chars2string function. The main function is called and the Joined string is printed to the screen.