1. a. 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. 2. b. Create three test cases, each consisting of a list of non-empty strings and a string of upper and/or lower case letters, for your function in Problem 1a. One of these tests should return the empty list. For each test case write two assignment statements and a function call that pass the test arguments to your function. b. Write a function named isDivisible that takes two parameters 3. maxInt, an integer 4. twoInts, a tuple of two integers The function isDivisible should create and return a list of all the ints in the range from 1 to maxInt (not including maxInt) that are divisible of both ints in twolnts. c. Create three test cases, each consisting of a value for maxInt and a value for twoints, for your function in Problem 2a. One of these tests should return the empty list. For each test case write two assignment statements and a function call that pass the test arguments to your function.
1. a. 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. 2. b. Create three test cases, each consisting of a list of non-empty strings and a string of upper and/or lower case letters, for your function in Problem 1a. One of these tests should return the empty list. For each test case write two assignment statements and a function call that pass the test arguments to your function. b. Write a function named isDivisible that takes two parameters 3. maxInt, an integer 4. twoInts, a tuple of two integers The function isDivisible should create and return a list of all the ints in the range from 1 to maxInt (not including maxInt) that are divisible of both ints in twolnts. c. Create three test cases, each consisting of a value for maxInt and a value for twoints, for your function in Problem 2a. One of these tests should return the empty list. For each test case write two assignment statements and a function call that pass the test arguments to your function.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 23PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage