Write a simple address book that lets save contact details

Assignment Help Python Programming
Reference no: EM132004460

Computational Thinking and Software Development Assignment -

Question 1 - Random Sentence Generator

Write a program that reads in files of words and produces random but structurally correct English sentences, according to the syntax (rules of grammar) specified on the next page.

Question 2 - An Addressbook

Using a dictionary indexed by nickname (a short favourite name), write a simple address book that lets you save these contact details.

  • nickname (can be anything you like)
  • name
  • address
  • phone-no

Each dictionary entry contains a dictionary of the details of that person, so names['Tom'] # will return the dictionary that contains all of Tom's details,

The program first displays a menu (something like that shown below) and carries out the appropriate action depending on which letter the user types, and then redisplays the menu.

add - prompt separately for each of name, address, phone-no and nickname. Then save all of these fields into a data structure. A dictionary is recommended but a list will also work.

find - prompt for a nickname, then search for the name, address and phone number of the person with this nickname in your addressbook and display their details. Make the search is case-insensitive i.e. only the letters matter, not whether they're upper or lower case delete prompt for a nickname, then find and display the related entry. Ask the user if this is the correct one to be deleted. If they reply "yes" delete it.

list - all list all the entries, numbered sequentially. Display all the fields and format them for easy reading. Some possibilities are shown below.

IMPORTANT: make sure that you use functions, usually one for each of the commands. You can of course, create any additional functions that you think will help to simplify or clarify your code.

Problem 1 - Create a list of unique words

Write program to that lets you repeatedly enter a sentence and builds a list of unique words. After each sentence is entered, display the total unique words seen so far.

Problem 2 - Maintaining a bank account

The following five functions allow you to maintain the running balance of an account and print out lines relating to each transaction.

You'll also need a global variable (balance?) to maintain the running balance of the account.

Your task is to:

1. Complete the five (very short) functions by creating the code for the body of each function, and

2. Demonstrate that you code works by calling the functions, as is demonstrated.

Attachment:- Assignment Files.rar

Reference no: EM132004460

Questions Cloud

What impact does this have on our sense of belongingness : To what extent we should believe in our personal values are aligned with the values of our organization and what impact does this have on
Marginal benefit versus marginal cost rule : It seems like the Marginal benefit versus marginal cost rule could be applied and could simplify the issue.
Essential elements of a market research report : Do they differ when buying supplies vs. services and if so, how? Support your discussion with examples.
How the effectiveness of loyalty programs : How the effectiveness of loyalty programs (i.e., frequent flyer program).how to effectively use loyalty programs to build true customer loyalty?
Write a simple address book that lets save contact details : 159.171 - Computational Thinking and Software Development Assignment. MASSEY UNIVERSITY. Write a simple address book that lets save contact details
Discuss at least three seller pricing strategies : Discuss at least three seller pricing strategies. What are the most appropriate market conditions for each? Support your discussion with examples.
Describe what is meant by abc analysis : Describe what is meant by ABC analysis. What is the purpose of this inventory technique - provide an example.
Handle in a global business : What are the cultural differences leadership or management will need to handle in a global business?
Characteristics of effective control systems : Describe your understanding of the major characteristics of effective control systems?

Reviews

len2004460

6/1/2018 6:59:13 AM

Detailed Question: Need this assignment in PyCharm 3.6 only. This is a basic python course for first year students who never had any python or programming background. For full marks - the sentences should be capitalised correctly and have a trailing full stop. The sentences generated by the ā€œSā€ command should conform to the specified grammar and meaningful variable names should be used & any complex parts should be commented. The explanation on the next page is a little wordy but the idea underlying is simple – you randomly select words from appropriate word lists and combine them so they're correct English sentences.

len2004460

6/1/2018 6:59:07 AM

Optional (no marks) - Possible extensions - This is fun program and there are lots of way you could extend it. You could: remember a noun from one sentence and reusing it in the next sentences, there's a conjunction wordlist (e.g. and) which isn't currently used. You could make your program create paragraphs by creating multiple sentences joined with conjunctions, possibly repeating the nouns to provide some continuity, make it remember all the sentences created in a list. Add a Favourites command which adds the most recently created sentence to a list of favourites.

len2004460

6/1/2018 6:59:02 AM

Does the name exist? When adding entries, as soon as the nickname is given, check to see if that nickname is already in the addressbook. If so, ask if the new entry should replace the existing one for that nickname. If the answer is no, then prompt again for a new nickname. To abort the add command (and find/delete), simply enter an empty string for the nickname. Be sure to an appropriate message if the user tries to find or delete an entry and the nickname isn't in use. IMPORTANT: make sure that you use functions, usually one for each of the commands. You can of course, create any additional functions that you think will help to simplify or clarify your code.

len2004460

6/1/2018 6:58:55 AM

What and how to submit - How: ALL submissions must be via Stream (not email) using the Assignment 3 submission link. What: Submit your Python programs, each named with .py extensions. You should have three .py files to submit, one for each question. Do not submit Word documents (.doc or .docx) or .zip files. Check that: all programs should display your name and ID number when starting. That your files have a .py extension.

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd