logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Jack StifunOthers
(5/5)

924 Answers

Hire Me
expert
Chander MohanEngineering
(5/5)

552 Answers

Hire Me
expert
Tracy BartramEnglish
(5/5)

536 Answers

Hire Me
expert
Puneet GuptaStatistics
(/5)

640 Answers

Hire Me
Others

three integer values Returns: an integer representing the median of the 3 parameters passed in pre

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

(15 pts) Write a function that meets the following specifications. You can assume “good” values – we will not pass you a list containing elements that are not integers. However, you should be prepared to handle empty lists: Name: transformer Parameters: a list of integers. Returns: A list of strings. The return list is an “associative list” such that each element in the returned list is “Even” if the integer in the corresponding index of the input list is even, “Odd” if the integer is odd. Example: transformer([1,2,3]) would return ['Odd', 'Even', 'Odd'] The list passed in is NOT mutable. Do not alter the contents of the original list. ------------ (15 pts) Write a function that meets the following specifications. You can assume “good” values – we will not pass you a list containing elements that are not integers. However, you should be prepared to handle empty lists: Name: mutate_transformer Parameters: a list of non-negative integers. Returns: Nothing. Side Effect: The list passed in as the parameter is mutated such that each index that held a 0 value now contains the Boolean False. Any other value that is not zero is changed to the Boolean True Example: mutate_transformer([1, 0, 0, 2, 1]) would modify the original list to: [True, False, False, True, True] Reminder: This function should NOT return a value. The list passed in is mutable ----------- 13. (15 pts) Write a function that meets the following specifications. You can assume “good” values – we will pass you a string: Name: substitute Parameters: a string, possibly containing many words. Returns: A new string that replaces occurrences of the letter “R” with the letter “W” IF and only IF the R is the first letter in the word. Do NOT replace the R if it is not the first letter of the word. Maintain proper case for the replacement (e.g. Race -> Wace; race -> wace) Example: "You rascally Rabbit! You really are annoying!" as input would return: "You wascally Wabbit! You weally are annoying!" -------------- 14. Median (15 points) The median is the “middle” value in a collection of data. Write a function to compute and return the median of three values. Assume “good” data. We will always pass your function 3 integers. Specification: Name: median(a, b, c) Parameters: a, b, c: three integer values Returns: an integer representing the median of the 3 parameters passed in PRE: Three integer values passed in Example: median(6, 2, 10) would return 6

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme