BYU logo Computer Science

To start this assignment, download this zip file.

Homework 3f — Structured Data

1. Pokemon

Write a program that queries the user for a sequence of Pokemon.

For each pokemon, the user will provide a name, type, and hit-points (HP) value.

The user provides an empty name to indicate they are done providing pokemon data.

Then the program queries the user for a pokemon type and prints the pokemon that has the maximum HP for that type.

Use the prompts and formatting as demonstrated in the example.

Example

Name: Charmander
Type: Fire
HP: 39
Name: Squirtle
Type: Water
HP: 44
Name: Blastoise
Type: Water
HP: 79
Name: Charizard
Type: Fire
HP: 78
Name: Rattata
Type: Normal
HP: 30
Name: Mudkip
Type: Water
HP: 50
Name: 
Get max HP for type: Water
Blastoise has the highest HP (79) for type Water.

2. Date Ideas

Write a program that helps the user organize date ideas.

Each idea has a description and a cost.

The user provides an empty idea to indicate they are done entering ideas.

Then the program queries the user for a maximum date cost and displays all the dates that are of equal or lesser cost.

Follow the prompts and formatting of the example.

Example

Date idea: Running
Date cost: 0
Date idea: Ice Cream
Date cost: 15
Date idea: Bowling
Date cost: 20
Date idea: Fancy Dinner
Date cost: 70
Date idea: Hiking the Y
Date cost: 0
Date idea: 
Get max cost for date: 20
Here are all the dates below $20:
- Running costs $0.
- Ice Cream costs $15.
- Bowling costs $20.
- Hiking the Y costs $0.

Tests

Be sure you can pass the tests before you turn in the assignment. Review the guide on using pytest if you need to review using pytest and what to do if a test fails.

Grading

ActivityPoints
Pokemon10
Date Ideas10

Manual grading will focus on decomposition, fluency, and appropriate use of tuples and unpacking.