CS160-Assignment 8 -Lists, Strings, and Functions Solved

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

 Orientation:

Reflect on terms/vocabulary in the class that has been used and not fully explained or defined, and you do not fully understand or have never even heard of, such as object-oriented programming, interpreter vs. compiler, etc.  Write a list of these terms in a document, and then you must look up these terms online or ask a TA or myself for further explanation.

 

If you cannot think of terms, here are some to investigate and explain:

Object-oriented programming

Cache

Compiler

Interpreter

Stack

Heap

 Design and Computation:

In order to do this assignment, you will need to know about lists, which we will cover this week in class and lab. Here is the documentation to help you with the functions you can use with a list: https://docs.python.org/3/tutorial/datastructures.html

Create a list of names, which you will get from the user. Write a function that outputs how many occurrences you find of each letter in all the names in the list. For instance, this would create an empty list, get a name from the user, and append it to a list.

name_list=[]

name=input(“Enter a name or exit: ”) name_list.append(name)

Create two lists of numbers, which you will get from the user, and you will write 5 functions to support the following tasks:

  • Return true or false if the lists are the same length.
  • Return the sum of a list
  • Return the average of a list
  • Return true or false if the sum of two lists are different
  • Return the common numbers between two lists.

Your program must use the functions to output information about the two lists to the user.

Requirement: Your program must not contain any global variables and handle all bad input!

Step 1: Understanding the Problem.

  • Do you understand everything in the problem? List anything you do not fully understand.
  • What are the functional requirements of the program, and what assumptions are you making?
  • What are the inputs, outputs, etc.?

Step 2: Devise a Plan.

  • What are the decisions that need to be made in this program?
  • How are you going to find all the occurrences of letters in the list of names?
  • How will you find common numbers between two lists?
  • How are you going to handle bad input?

Based on your answers above, list the specific steps or provide a flowchart of what is needed to create this calculator with two modes. Be very explicit!!!

Step 3: Carry out the plan.

This is the Python code that implements the functions and getting the lists from the user outlined above.

Step 4: Looking Back.

Create a test plan with the test cases (bad, good, and edge cases).  What do you hope to be the expected results?

  • What are the good, bad, and edge cases for ALL input in the program?
  • What are the actual results from testing this data?

 

 

  • Assignment8-qpc4ah.zip