Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Save the Northern Hairy-nosed Wombat (SNHW) has been getting so many donations recently, that they are struggling to handle all of the phone calls

Problem

Save the Northern Hairy-nosed Wombat (SNHW) has been getting so many donations recently, that they are struggling to handle all of the phone calls coming into their office. For this reason, the SNHW CEO would like you to develop a program called Donator which will let a sponsor easily record their details, including their name, phone number and the amount that they would like to donate. This information should be saved to a file called donations.txt, so that someone from the office can call the sponsor back to process their donation, when they have time. The Donator program must use a Graphical User Interface (GUI) to input the sponsor's information. Details of how to build a simple GUI in Python using tkinter have been covered in week 10.

Your program should handle errors with user input (e.g. a phone number which contains letters), and IO errors when writing to the file. In the case that an error is encountered, your program should open a pop-up window with the details. If there are no errors, then your program should open a pop-up window thanking the user for their donation, and then close the program.

Your GUI should look something like the below picture, although the actual window may look slightly different depending which operating system you are running it on (remember to make sure that your program works on turing, before submitting it).

Your pop-up error message should look something like this:

Finally, the thank-you message when the sponsor correctly inputs their details should look something like this:

Note:

You can accept any string as the name, provided that it is not empty.

To be valid, a phone number must contain exactly ten digits, the first of which is a zero, and must not contain any letter, symbols, etc.

The donation amount must be between 0.01 and 999.99, and must not contain more than two decimal places.

You can use the tkinter.messagebox module to generate pop-up messages.

Example Interactions

Assuming that the donations.txt file initially does not exist, then given the following user input:

Your donations.txt file should have the following text:

Name : Samuel Ray Phone number : 0400000001 Amount : 23.50

If you run your program again, with the following input

Your donations.txt file should now have the following:

Name : Samuel Ray Phone number : 0400000001 Amount : 23.50 Name : Mary Jones Phone number : 0400000002 Amount : 100.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

Describe the various sources of export assistance.

Answered: 1 week ago