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
Vanyuwa [196]
3 years ago
8

Problem 1a. Write a function named hasFinalLetter that takes two parameters 1. strList, a list of non-empty strings 2. letters,

a string of upper and/or lower case letters The function hasFinalLetter should create and return a list of all the strings in strList that end with a letter in letters.
Computers and Technology
1 answer:
mash [69]3 years ago
8 0

Answer:

The answer is the programming in Python language has strings and characters that has to be declared in the method.

Explanation:

#method

def hasFinalLetter(strList,letters):

output = #output list

#for every string in the strList

for string in strList:

#findout the length of each string in strList

length = len(string)

#endLetter is last letter in each string

endLetter = string[length-1]

#for each letter in the letters list

for letter in letters:

#compare with endLetter

#if we found any such string

#add it to output list

if(letter == endLetter):

output.append(string)

#return the output list

return output

#TestCase 1 that will lead to return empty list

strList1 = ["user","expert","login","compile","Execute","stock"]

letters1 = ["a","b","y"]

print hasFinalLetter(strList1,letters1)

#TestCse2

strList2 = ["user","expert","login","compile","Execute","stock"]

letters2 = ["g","t","y"]

print hasFinalLetter(strList2,letters2)

#TestCase3

strList3 = ["user","expert","login","compile","Execute","stock"]

letters3 = ["k","e","n","t"]

print hasFinalLetter(strList3,letters3)

You might be interested in
To maintain audience interest in a multimedia presentation, use animations or transition features to control when objects or tex
ira [324]

Answer:

True

Explanation:

A "multimedia presentation" refers to a presentation that uses <em>texts, images, audios, animations, photographs and the like </em>in order to help a particular set of audience understand. The presenter's ideas become clear because the audience can deeply grasp the meaning through different graphics and colors presented.

So, <em>the answer above is definitely true</em> because using animations or transitions figures to control when objects or texts appear can <u>prevent boredom</u> on the end of the audience. This will spark interest on their end.

However, it is important not to overdo it because this will cause further distraction that will divert your audience's attention. It should also be <u>conservative and consistent.</u>

4 0
3 years ago
12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
notsponge [240]

Answer:

Explanation:

The following code is written in Java, it asks the user for the number of inputs that will be made and then the inputs. These inputs are placed into an array. Then the array is sorted and printed out to the terminal.

public static void sortArrayList() {

           ArrayList<Integer> sortedList = new ArrayList();

           Scanner input = new Scanner(System.in);

           System.out.println("Enter number of digits in Array");

           int numberOfInputs = input.nextInt();

           for (int i = 0; i < numberOfInputs; i++) {

                   System.out.println("Enter a number");

                   sortedList.add(input.nextInt());

           }

           int n = sortedList.size();

           for (int i = 0; i < n; i++)

               for (int j = 0; j < n-i-1; j++)

                   if (sortedList.get(j) > sortedList.get(j + 1))

                   {

                       // swap arr[j+1] and arr[j]

                       int temp = sortedList.get(j);

                       sortedList.set(j, sortedList.get(j + 1));

                       sortedList.set(j + 1, temp);

                   }

           for (int x : sortedList) {

               System.out.println(x);

           }

       }

7 0
3 years ago
Ten output devices you know
jasenka [17]
Monitor
Printer
Headphones
Computer Speakers
Projector
GPS
Sound Card
Video Card
Braille Reader
Speech-Generating Device

6 0
3 years ago
Explain the role of ICT in banks​
vladimir1956 [14]

Answer: ICT help banks improve the efficiency and effectiveness of services offered to customers, and enhances business processes, managerial decision making, and workgroup collaborations, which strengthens their competitive positions in rapidly changing and emerging economies.

Explanation: please give branliest I only need one more to make ace

7 0
2 years ago
Which best describes the benefits of renting a home
ANTONII [103]
Is it multiple choice or an essay question? If its an essay question I would say Living alone, being able to rent YOU'RE own home, and probably being able to decorate it the way you want. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
    9·2 answers
  • When the increment or decrement operator is placed before the operand (or to the operand's left), the operator is being used in
    6·1 answer
  • What type of social engineering attack uses email to direct you to their their website where they claim you need to update/valid
    6·2 answers
  • Drivers should scan 10-12 secound down the road looking of potential hazards
    5·1 answer
  • A user complains that his computer automatically reboots after a short period of time. Which of the following computer component
    13·1 answer
  • You change a document that is saved on your computer by cutting text from the document what happens to the text when you preform
    5·1 answer
  • Which of the following feature are parts of Toyota’s safety system?
    10·1 answer
  • You are creating a presentation and you have come to the last slide. You still have more information to add. What should you do?
    7·1 answer
  • List the five parts of a system.describe them.
    13·1 answer
  • The cameras picture review function allows you to look at the _ you've taken
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!