Page 1 of 1

Programming Assignment 1 Decoding An Alien Message ("cc", "c"), ("cbc", "c"), ("accccadadadabadabadabcaaaa", "a") ] Due

Posted: Sat May 14, 2022 7:05 pm
by answerhappygod
Programming Assignment 1 Decoding An Alien Message Cc C Cbc C Accccadadadabadabadabcaaaa A Due 1
Programming Assignment 1 Decoding An Alien Message Cc C Cbc C Accccadadadabadabadabcaaaa A Due 1 (183.14 KiB) Viewed 42 times
Programming Assignment 1 Decoding An Alien Message ("cc", "c"), ("cbc", "c"), ("accccadadadabadabadabcaaaa", "a") ] Due Date def testFirstCase(self): for each in self._testcases_: Sections(100,950) 5/13/22 @ 11:59pm self.assertEqual (your filenameishere.findLocationLetter(each[@]), each[1], "Something is wrong") if . Goal In this programming assignment, you will use the divide-conquer-glue technique and recursive implementation to solve the problem. !!! IF YOUR PROGRAM IS NOT A RECURSIVE IMPLEMENTATION, YOU WILL AUTOMATICALLY RECEIVE ZERO!!! _name__ == "__main": #import sys: sys.argy = ['', 'Test.testName'] '] unittest.main() To run the test file, you need to replace your filenameishere with your file name. Please choose unittest according to Step 3. Test your first Python application | PyCharm (jetbrains.com) that provides more information about how to run and debug a test case file. Problem Statement Last year there was an alien ship abducting people on Earth. To find these people, our brilliant scientists are able to intercept a message sent by the Aliens. A message is a string consisting of 26 English characters (a-z). In fact, a location of where the abducting people are currently located depends on the character that appears more than where n is the length of a message. The character appearing more than half of a message's length is called a location letter of the message. Since the abducting people are located only in one place, there is ONE and ONLY ONE location letter in an alien message. What You Need to Submit 1. Please answer the following questions. You can use the template file (40 points) a. What is/are the base case/cases for this problem? b. For the non-base case, i. (Divide Step) How many subproblems do you have? Clearly explain each subproblem. ii. (Conquer Step) How can you solve each subproblem. iii. (Glue Step) How can you glue all solutions to the subproblems together? 2. Your complete Python Program. (60 points) Now you are asked to help our brilliant scientists by writing a program that can find the location letter in an alien message intercepted by the scientist. Coding Standards The Design Information Here is the definition of a Python function: You must adhere to all conventions in the CS 1120 Python coding standards (discussed in class and in the Lab). This includes the use of white spaces and indentations for readability, and the use of comments to explain the meaning of various methods and attributes. Be sure to follow the conventions also for naming classes, variables, method parameters and methods. def find Location Letter(message) where message is a String and the function returns the location letter that appears more than half o. . Sample Test Data We use Python Unittest framework to test your program. Here is a sample test file: import unittest import yourfilenameishere Assignment Submission You should submit the following two files: o Design File O Program Files class Test(unittest. TestCase): def setup(self): self._testcases __ = [("abccccaca", "c"), = -