Can you do my CS112 assignment?

Do My Homework Service Links: Online Assignment Help, Do My Assignments Online -

The assignment should be done on python. every instructions will be on the file I will be posting. Also when you finish the code use the example code that is on the file that I'll provide to check if the code works. 

Get Help With a similar task to - Can you do my CS112 assignment?

Additional Instructions:

CS 112 – Spring 2020 – Programming Assignment 8 Functions Due Date: Sunday, April 5th, 11:59pm Assignment basics file:  https://piazza.com/class_profile/get_resource/k4wblafqtoj2cx/k5x3ennufm34cg Tester file:  will be available in a few days Background The purpose of this assignment is to practice writing function definitions, and using functions inside of other functions to solve complex problems. Guidelines  You are not allowed to import anything.  You are not allowed to use sets and dictionaries  You are not allowed to use anything that hasn’t been covered in class, including the list comprehension construct (if you don’t know what this is, don’t worry, it’s impossible to use it by accident!)  From built-in functions, you are allowed to call only range(), len(), int(), str(), list()  From list methods, you are allowed to use only .append() and .insert(). Please do not ask on piazza whether you can use .sort(), .count() etc.  You are allowed to use slicing, but you are not allowed to use .split(), .join(), or .replace().  You can use any method for removing items from a list.  You are not allowed to hard-code exhaustive if-elif-elif statements to handle all possible list lengths. Your code should work with any list length. Assumptions You may assume that: • The types of the values that are sent to the functions are the proper ones, you don’t have to validate them (e.g. word is a string, not an integer, etc.). • The functions are going to be called with usable values, you don’t have to validate them (with the exception of exchange.) 1 https://piazza.com/class_profile/get_resource/k4wblafqtoj2cx/k5x3ennufm34cg Testing In this assignment testing will be done as before. You will start working on the assignment without a tester, and you will do your own testing based on the examples we provide in this document as well as other examples you can come up with. A few days later we will provide an actual tester but don’t wait for it in order to start working on the assignment as there won’t be enough time to complete it before the deadline. The purpose of the delayed release of the tester is for you to put more emphasis/effort on writing logically correct programs instead of trying to pass certain tests only. When we post the tester, we’re going to omit some of the test cases that will be used for grading. This means that there might be errors in your code even if the tester is giving you no errors. You must do your own checks to make sure that you haven’t missed anything and your code is correct. You do not need to modify the tester, just test on your own any way you like. Again, the goal is to help you put more focus on writing logically correct programs instead of trying to pass certain tests only. Grading Rubric Submitted correctly: Code is well commented: Tester calculations correct: Unknown test cases TOTAL: 2 8 60 30 100 # see assignment basics file for file requirements! # see assignment basics file for how to comment! # see assignment basics file for how to test! # test cases that are omitted from the tester Note: If your code does not run and crashes due to errors, it will receive zero points. Turning in running code is essential. 2 Functions A description for the behavior and signature of each function is provided below. We are not giving the signatures or a description of the parameters to you directly. Part of this assignment is that you must determine the correct signature yourself! one_diff(???): Description: Determine if there is exactly one character different between exactly two strings. Parameters: Determine these from the description, and the provided examples. Return value: True If there is exactly one character different, False otherwise Example: one_diff("banana", "apple") → False one_diff("need", "reed") → True one_diff("goof", "good") → True one_diff("food", "feed") → False exchange(???): Description: Construct a new string by swapping the character at one provided index with the character at another provided index. All occurrences of both characters should be exchanged with one another. By default, the first character should be swapped with the last character in the original string. You should make sure that the indices given to the function are valid, and return the original string (unchanged) if either index is invalid. Parameters: Determine these from the description, and the provided examples. Return value: A string, the new version of the string after swapping the appropriate characters, or the original string because the indices provided were invalid. Examples: exchange("banana") → "abnbnb" exchange("banana", 2) → "bnanan" exchange("strawberry") → "ytrawberrs" exchange("strawberries", 2, 4) → "stwarbewwies" exchange("strawberries", -2, -4) → "steawbreeirs" exchange("constitution", 53) → "constitution" 3 is_chain(???): Description: Determine if each successive string given to this function are different by one character. You will get a zero for this portion of the assignment if you do not appropriately call one_diff in the definition of this function. Parameters: Determine these from the description, and the provided examples. Return value: True If the strings form a chain, False otherwise. Example: is_chain() → False is_chain("road") → True is_chain("road", "toad") → True is_chain("road", "toad", "toat") → True is_chain("road", "toad", "loan") → False scramble(???): Description: Scramble the characters in a string by swapping each successive pair of characters until you reach the end of the string. Odd-length strings should just skip trying to use the last character for a swap. You will get a zero for this portion of the assignment if you do not appropriately call exchange in the definition of this function. Here's a detailed example: scramble("spongebob") First, swap the characters at index 0 and 1, yielding: "psongebob" Then, using the previous result, swap the characters at index 2 and index 3, yielding: "psnogebnb" Then, swap the characters at index 4 and 5, yielding: "psnoegbnb" Then, swap the characters at index 6 and 7, yielding: "psboegnbn" Since this is an odd-length string, "psboegnbn" is the final answer. Parameters: Determine these from the description, and the provided examples. Return value: The scrambled string. Example: scramble("apples") → 'pllase' scramble("sandycheeks") → 'asdncyekkha' scramble("masonpatriots") → 'atompntsirmso' scramble("somewhereovertherainbow") → 'obewhvwawbswamvwatnirbh' 4

CS 112 – Spring 2020 – Programming Assignment 8 Functions Due Date: Sunday, April 5th, 11:59pm Assignment basics file:  https://piazza.com/class_profile/get_resource/k4wblafqtoj2cx/k5x3ennufm34cg Tester file:  will be available in a few days Background The purpose of this assignment is to practice writing function definitions, and using functions inside of other functions to solve complex problems. Guidelines  You are not allowed to import anything.  You are not allowed to use sets and dictionaries  You are not allowed to use anything that hasn’t been covered in class, including the list comprehension construct (if you don’t know what this is, don’t worry, it’s impossible to use it by accident!)  From built-in functions, you are allowed to call only range(), len(), int(), str(), list()  From list methods, you are allowed to use only .append() and .insert(). Please do not ask on piazza whether you can use .sort(), .count() etc.  You are allowed to use slicing, but you are not allowed to use .split(), .join(), or .replace().  You can use any method for removing items from a list.  You are not allowed to hard-code exhaustive if-elif-elif statements to handle all possible list lengths. Your code should work with any list length. Assumptions You may assume that: • The types of the values that are sent to the functions are the proper ones, you don’t have to validate them (e.g. word is a string, not an integer, etc.). • The functions are going to be called with usable values, you don’t have to validate them (with the exception of exchange.) 1 https://piazza.com/class_profile/get_resource/k4wblafqtoj2cx/k5x3ennufm34cg Testing In this assignment testing will be done as before. You will start working on the assignment without a tester, and you will do your own testing based on the examples we provide in this document as well as other examples you can come up with. A few days later we will provide an actual tester but don’t wait for it in order to start working on the assignment as there won’t be enough time to complete it before the deadline. The purpose of the delayed release of the tester is for you to put more emphasis/effort on writing logically correct programs instead of trying to pass certain tests only. When we post the tester, we’re going to omit some of the test cases that will be used for grading. This means that there might be errors in your code even if the tester is giving you no errors. You must do your own checks to make sure that you haven’t missed anything and your code is correct. You do not need to modify the tester, just test on your own any way you like. Again, the goal is to help you put more focus on writing logically correct programs instead of trying to pass certain tests only. Grading Rubric Submitted correctly: Code is well commented: Tester calculations correct: Unknown test cases TOTAL: 2 8 60 30 100 # see assignment basics file for file requirements! # see assignment basics file for how to comment! # see assignment basics file for how to test! # test cases that are omitted from the tester Note: If your code does not run and crashes due to errors, it will receive zero points. Turning in running code is essential. 2 Functions A description for the behavior and signature of each function is provided below. We are not giving the signatures or a description of the parameters to you directly. Part of this assignment is that you must determine the correct signature yourself! one_diff(???): Description: Determine if there is exactly one character different between exactly two strings. Parameters: Determine these from the description, and the provided examples. Return value: True If there is exactly one character different, False otherwise Example: one_diff("banana", "apple") → False one_diff("need", "reed") → True one_diff("goof", "good") → True one_diff("food", "feed") → False exchange(???): Description: Construct a new string by swapping the character at one provided index with the character at another provided index. All occurrences of both characters should be exchanged with one another. By default, the first character should be swapped with the last character in the original string. You should make sure that the indices given to the function are valid, and return the original string (unchanged) if either index is invalid. Parameters: Determine these from the description, and the provided examples. Return value: A string, the new version of the string after swapping the appropriate characters, or the original string because the indices provided were invalid. Examples: exchange("banana") → "abnbnb" exchange("banana", 2) → "bnanan" exchange("strawberry") → "ytrawberrs" exchange("strawberries", 2, 4) → "stwarbewwies" exchange("strawberries", -2, -4) → "steawbreeirs" exchange("constitution", 53) → "constitution" 3 is_chain(???): Description: Determine if each successive string given to this function are different by one character. You will get a zero for this portion of the assignment if you do not appropriately call one_diff in the definition of this function. Parameters: Determine these from the description, and the provided examples. Return value: True If the strings form a chain, False otherwise. Example: is_chain() → False is_chain("road") → True is_chain("road", "toad") → True is_chain("road", "toad", "toat") → True is_chain("road", "toad", "loan") → False scramble(???): Description: Scramble the characters in a string by swapping each successive pair of characters until you reach the end of the string. Odd-length strings should just skip trying to use the last character for a swap. You will get a zero for this portion of the assignment if you do not appropriately call exchange in the definition of this function. Here's a detailed example: scramble("spongebob") First, swap the characters at index 0 and 1, yielding: "psongebob" Then, using the previous result, swap the characters at index 2 and index 3, yielding: "psnogebnb" Then, swap the characters at index 4 and 5, yielding: "psnoegbnb" Then, swap the characters at index 6 and 7, yielding: "psboegnbn" Since this is an odd-length string, "psboegnbn" is the final answer. Parameters: Determine these from the description, and the provided examples. Return value: The scrambled string. Example: scramble("apples") → 'pllase' scramble("sandycheeks") → 'asdncyekkha' scramble("masonpatriots") → 'atompntsirmso' scramble("somewhereovertherainbow") → 'obewhvwawbswamvwatnirbh' 4

Related Questions

Find Related Questions Here