Question: CS 160 Assignment 04 For this assignment, you will create a more complex modular program that uses at least two parallel lists for storing related

CS 160 Assignment 04

For this assignment, you will create a more complex modular program that uses at least two parallel lists for storing related information, and has at least one loop that accesses the data in the lists. As long as your program satisfies the requirements listed below, you are free to design and write any type of program that you care to. You are encouraged to be creative, and pick something that has meaning for you, because you'll have more fun. Feel free to create a more complex version of the program you did in an earlier lab, as long as it meets all of the additional requirements below.

There are two components to this assignment:

  1. Algorithmic Design Document - a04 (save as a .pdf or .docx file)

  2. Python Program - a04.py

Problem Description

  1. Write an interactive application in Python that uses at least 2 parallel lists for storing related information in a meaningful manner. Some examples may include: student name and gpa, pet name and age, stock name and price, etc.

  2. The program must use loops to process the lists to calculate other information. For example, the student with the highest/average gpa, the average pet age, the highest/lowest stock price, etc.

Algorithmic Design Document Requirements

  1. Make a copy of the Algorithmic Design Document Template.

  2. Start with a sample run to help with the design process.

  3. Plan the logic steps for your algorithm. You must answer the following questions with numbered steps and clear instructions to solve the problem.

    1. Identify all of the user input. What are the data types of the inputs? Define the input variables.

    2. Describe the program output. What is displayed to the user? What are the data types of the output? Define the output variables.

    3. What calculations do you need to do to transform inputs into outputs? List all formulas needed, if applicable. If there are no calculations needed, state there are no calculations for this algorithm.

    4. Describe the process needed to transform inputs to outputs using numbered steps. Here is where you would use conditionals, loops, functions or list constructs (if applicable) and explain the process in transforming inputs into outputs.

Python Program Requirements

  1. Finally, create your Python program.

  2. Look at the Assignment Rubric. You will be graded on the following coding constructs:

    1. variables

    2. input/output

    3. input validation

    4. computation

    5. iteration

    6. functions

    7. parameters

    8. parallel lists

  3. Include the required comment header (see style guide) and any explanatory comments in your code (always explain any mathematical calculations).

  4. Run your program and test with different user input. Do your prompts explain what the user should enter?

  5. Take a look at your user interface (UI) and user experience (UX). Did you provide a welcome message letting the user know what to expect? Is the UI nicely spaced with no typos?

  6. You must use functions to validate all user input. For each prompt, create a function to prompt for and return valid input. If the user enters invalid input, an error message should be displayed and use a loop to prompt again.

  7. Use parameters and arguments to pass values into your modules (don't use global variables).

  8. Look at this Assignment 04 Sample for an example and tutorial video.

Deliverables

Submit to Assignment 04 in D2L:

  1. Your design: Name your algorithmic design document a04 (save as a .pdf or .docx file) and upload to D2L.

  2. Your code: Name your file a04.py and upload to D2L. Be sure to comment your code as required (see style guide), and to acknowledge any sources of help you may have received.

  3. Compare your document and program with the rubric before submitting.

Sample Run #1

Look at the sample run from a student gpa program below (output placed in 2 columns to save space), user input is in blue. Two lists are used, one for the student name, and another for the GPA. Notice the input validation happening when the user enters an invalid menu option, and an invalid numeric answer:

----- Student GPA Application -----

Enter a list of student names and GPAs when prompted and the program will

display the student with the highest GPA and the class average GPA.

Enter student name: Sam

GPA: 2.8

Add another? (y/n): y

Enter student name: Vasanth

GPA: 3.9

Add another? (y/n): y

Enter student name: Teresa

GPA: c

Not a GPA.

GPA: 5

Invalid GPA!

GPA: 4.3

Add another? (y/n): y

Enter student name: Luis

GPA: 3.8

Add another? (y/n): y

Enter student name: Sally

GPA: 2.9

Add another? (y/n): n

Teresa has the highest GPA: 4.3

The average GPA is: 3.54

Goodbye!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!