2a. and 2b.

2a. This program is written in python. Its purpose is to allow the user to create a shopping list. They can add items, remove items, and see the working list. When the user is finished, the list is saved. The video shows the program running in a terminal window. First, the name of the user is input, then the user can choose to see the list, add an item, remove an item, or quit the program. The user adds three items, removes an item, adds an item, looks at the list, then enters 'quit'.

2b. First I created a program that gave the user the information necessary to run the program - 1 shows the list, 2 adds to the list, 'quit' exits the program - and accepted input from the user. Then I added functions that perform the commands of 1 and 2. When the input was entered, the program performed the command. Additionally, a greeter function greeted the user at the beginning of the program, clearing the terminal window beforehand. Next, I added two functions to get the name of the user (enter username) and to remove an item from the list (enter 3) and used cprint to print some outputs in different colored text. Finally, I added a new function that called the functions to show the list, add to the list, and remove from the list, and made it so that the shopping list was saved in a new file when the program was quit. One challenge was that if the user did not enter appropriate information, the program would repeat itself, so I added an 'else:' option to tell the user that the input was not an option and to try again. This program was independent.

Comments

Popular posts from this blog

Marconi Feedback

Create Task Day 4

CS50 Hello World