Strathit.files.wordpress.com



Year 10 Information Technology: Python Programming Task-5334043815000Now that you have been making Python programs for a few weeks you have the knowledge and skills to make a simple programme of your own.Programme descriptionThe program you make will have a menu that allows users to choose what they want to do. The first option will be to multiply two numbers, the second option will be to add two numbers and the third option will be to count the characters in a string. They can also type “quit” to exit the program. The menu should look something like this:Welcome to the menu program.Please select from the menu by typing the number.To exit the program, type 'quit' 1. Multiply two numbers 2. Add two numbers 3. Count characters in a stringChoose a number:When the user types 1, the program will ask for two numbers and then give the result in the following format:3 x 4 = 12When the user types 2, the program will ask for two numbers and then give the result in the following format:2 + 2 = 4When the user types 3, the program will ask for some text and then report to the user:There are 11 characters in that string.Once the program is started up it should keep showing the menu until the user types “quit”If the user types an option other than 1, 2, 3 or quit, they should get a message like:That is not a valid option. Please enter 1, 2, 3 or quit.ResourcesAll the programs you have written so far contain the methods you need to complete this task. The teacher will be on hand to guide you and you can consult with your fellow students for assistance. Also take notice of the marking key on the next page for hints on what might be required.Suggested methodStart by trying to get the menu to display properly.Then work on getting the menu to respond differently when different numbers are typed. To show that they work you could just print a different message for each option. Don’t forget to put in an error message.Make the program loop so that after an option is chosen, the menu displays again.Once the menu and the looping works then put in the code to make each menu option work with the multiplication, addition and string counting.Python Programming Task Marking keyTask descriptionPossible MarksYour MarksDisplay:MenuMulitplicationAdditionString countError message21111Sub-Total6Functionality:MenuMultiplicationAdditionString countLoopingBranching422222Sub-Total14Total20 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download