I used some code found online I need to apply the instructors feedback and make this my own. It shouldn't be plagiarized and incorporate his feedback. Please review my code in document and the teachers remarks in PDF.
CPT200 – Week-2 Interactive Assignment – General Feedback When you’re a professional coder, the priority is to complete tasks as efficiently and fast as possible. In practice, you are encouraged to visit consulting sites like Stack Overflow and GitHub in order to look at how someone solved a problem, and integrate it into your own code. GitHub for instance, is commonly used to host open-source software projects (https://github.com/). It has been reported that as of June 2018, GitHub has over 28 million users and 57 million repositories. In other words, sharing and repurposing existing code are increasingly becoming standard practices in the software development field. However, to demonstrate originality with your code in the academic setting, you are encouraged to improve the code that you found online. Please read the following article on how to code without plagiarizing: https://www.turnitin.com/blog/plagiarism-and-programming-how-to-code-without-plagiarizing-2 This week interactive assignment was intentionally created similar to the question that can be found in the following Stack Overflow link: https://stackoverflow.com/questions/32660778/mixing-colors-program. As mentioned before, you are encouraged to use existing solutions, but you are also required to pay attention to the technical specification that describes the internal implementation of your software. The following code will demonstrate to you how to employ the list data structures and how to avoid plagiarizing by changing the code that can be found in the above Stack Overflow link. After you review the code, please make sure to reproduce/retype it, and then test it to ensure the developed functionality meets the following requirements: 1- For primary colors, users can only enter one of the following (red, blue, yellow) 2- Users can’t enter the same primary color twice 3- The code is not case sensitive so you can enter either UPPER or lower case letters (RED or red) Once you have tested the following program, identify the advantages and disadvantages of using list data structures, take a screen shot of the completed functionality (including the input and the output) and save it in a Word document, along with the script. Please make sure to submit your document before the end of Monday. https://en.wikipedia.org/wiki/Open-source https://github.com/ https://en.wikipedia.org/wiki/Repository_(version_control) https://www.turnitin.com/blog/plagiarism-and-programming-how-to-code-without-plagiarizing-2 https://stackoverflow.com/questions/32660778/mixing-colors-program Note: The following solution is one of many possible solutions for the CPT200 Week2 Interactive Assignment. References: TurnItIn (2019). Plagiarism and Programming: How to Code Without Plagiarizing. Retrieved from http://turnitin.com/en_us/resources/blog/2660-plagiarism-and-programming-how-to-code-without-plagiarizing-2 NYTimes (2019). Microsoft Buys GitHub for $7.5 Billion, Moving to Grow in Coding’s New Era. Retrieved from https://www.nytimes.com/2018/06/04/technology/microsoft-github-cloud-computing.html StackOverflow (2015). Mixing colors program. Retrieved from https://stackoverflow.com/questions/32660778/mixing-colors-program http://turnitin.com/en_us/resources/blog/2660-plagiarism-and-programming-how-to-code-without-plagiarizing-2 https://www.nytimes.com/2018/06/04/technology/microsoft-github-cloud-computing.html https://stackoverflow.com/questions/32660778/mixing-colors-program Week 2 Interactive Assignment Color Mixer CPT200: Fundamentals of Programming Languages Dr. Amjad Alkilani March 11, 2021 Red and blue = purple Red and yellow = orange Blue and yellow = green Part 1 User input: print ("Color Mixer") primarycolor1 = input( "Enter primary color 1: ") primarycolor2 = input( "Enter primary color 2: ") print() Part 2: Color Output if ( primarycolor1 == "red" and primarycolor2 == "blue" ) or \ ( primarycolor1 == "blue" and primarycolor2 == "red" ): print( primarycolor1 + " mix with " + primarycolor2 + " is purple " ) elif ( primarycolor1 == "red" and primarycolor2 == "yellow" ) or \ ( primarycolor1 == "yellow" and primarycolor2 == "red" ): print( primarycolor1 + " mix with " + primarycolor2 + " is orange " ) elif ( primarycolor1 == "blue" and primarycolor2 == "yellow" ) or \ ( primarycolor1 == "yellow" and primarycolor2 == "blue" ): print( primarycolor1 + " mix with " + primarycolor2 + " is green " ) else: print( "One color must atleast match, " + primarycolor1 + " and " + \ primarycolor2 + " is not a primarycolor given" ) Process in developing the program: 1. First start by programming a prompt that ask the user to enter the name of two colors. Start by asking the user for two colors utilizing the input function. Once the user types in something it will need to be stored in a variable. The variables for this program is the primarycolor1; primarycolor2. Color is stored in the variable. a. primarycolor1 = input( "Enter primary color 1: ") b. primarycolor2 = input( "Enter primary color 2: ") 2. The we will create an “If” statement or a code to handle of the users input of the two colors because the colors chosen can be picked in different orders i.e... red + blue=purple or blue + red=purple. The statement must be two sided because of this which is why we use ==. The “==+ command is used to compare both side of the statement. If you used “=” it only compares the left side to the right. Making the script invalid if the user right the colors in reverse order. a. if ( primarycolor1 == "red" and primarycolor2 == "blue" ) or \ b. ( primarycolor1 == "blue" and primarycolor2 == "red" ): 3. We need to create a “elif” statement that covers if the color is something other than red and blue. The script is also broken to accommodate the 80 characters or less in the python program which is the reason for the (\). We do the elif statement two times to cover all the colors listed to be used. a. elif ( primarycolor1 == "red" and primarycolor2 == "yellow" ) or \ ( primarycolor1 == "yellow" and primarycolor2 == "red" ): print( primarycolor1 + " mix with " + primarycolor2 + " is orange " ) b. elif ( primarycolor1 == "blue" and primarycolor2 == "yellow" ) or \ ( primarycolor1 == "yellow" and primarycolor2 == "blue" ): print( primarycolor1 + " mix with " + primarycolor2 + " is green " ) 4. If the users types any other combinations of colors than the ones listed than there should be an error. An “else” statement is used and the “print” command is used to display the error message to the user.. a. else: print( "One color must atleast match, " + primarycolor1 + " and " + \ primarycolor2 + " is not a primarycolor given" )