Total for each exam in a 2D list…………. Average for each student in a 2D list………………….. Converting hexadecimal to denary……………………… Calculating the file size of a sound file……………….. Write a subprogram that has three parameters, num1, num2 and num3. The program should take three numbers as arguments and return the highest number. Hint: You may consult the lowest number program on page 5.
Write a subprogram which generates a username for a teacher based on their first name and surname. The format should be their surname, followed by the first letter of their first name. The program should check to see if the username already exists in users. Hint: You may consult programs on page 6 and 16 users. Then demonstrate how you would call the function on the previous page to generate a username and output this in a meaningful message. The next two pages are provided so that you can practise Challenges 1 and 2 without the writing frames. Write a subprogram that takes the length, width and height as arguments and return the volume of the cuboid.
After writing the function, show how you might use the function to output an answer with a meaningful message. Write a program which simulates two dice being rolled. Output the values of both dice. Keep prompting the user to roll the dice until the two dice match e. Double 6. For all other combinations, ask the user to press Enter to roll again.
Hint: You may consult the while loop programs on pages 11 and Iterate through the sentence below and count how many times each vowel occurs. You can iterate through the sentence in the same way you iterate through a list or list. Extra challenge, store the vowel counters in a list or 2D list. Write a program which iterates through a list of numbers and outputs the highest number I dare you to pass the list into a function! Hint: Page Write a program which asks the user to enter a desired password. Perform a linear search through a list of obvious weak passwords.
Extra challenge: You may also want to add in various validation checks.
Books & Articles
One example might be a length check, so if the password does not meet a particular length it is also declared weak. Meaningful messages are necessary for each different validation check. An A-Level student wants to find out how many marks are required to receive a certain grade. Write a program which simulates a penalty shootout. The computer is the goalkeeper and dives a random direction or stays in the centre each turn. If the player typed left and the keeper dives left, the penalty is saved etc. The program repeats 5 times. After 5 penalties, the winner is announced with a meaningful message.
Hint: Pages 10 and I strongly advise using a pencil for this one!
Write a subprogram to allow a teacher to register a new account. The subprogram should take the username and password as arguments and write these details to the existing users. Hint: Use the comments on the opposite page as skeleton code to structure your subprogram. Write the main function which contains your list and which calls the subprogram function Hint: Pages 7, 18, Write a program which will output the total for each exam with a meaningful message. Hint: As the focus is on each exam rather than each student, the outer for loop will be for each exam.
The Little Book (Edwards novel) - Wikipedia
Remember to reset the total after each iteration of the inner loop. Write a subprogram that takes the 2D list of exam results as an argument and outputs the mean average for each student. Hint: Remember to reset the total to 0 after outputting the average for each student. Write a function which takes in 1 hexadecimal digit as an argument and returns the denary equivalent.
Write a main function which asks the user to input a hexadecimal value and then passes this value to the function you have written. Hint: Pages 7 and Write a subprogram which takes the sampling frequency, bit depth, channels and duration of a sound file and returns the file size. This can then be outputted in Kilobytes and Megabytes. Eirini Kolaiti came up with the great idea of putting example solutions to the challenges at the back of the book.
Even if the algorithm is well-defined, there may be alternative programming approaches. The following pages present examples which you can compare to your own answers. Comments have been provided to aid your understanding, you should develop the habit of commenting all your programs. Do not worry if you have written an alternative solution. Also be aware that these solutions were not produced by typing the whole program out and running them with no syntax and logic errors on the first time!
There was a debugging process as I wrote each line or block of code. Both also require perseverence to develop fluency. The generosity of those who produce resources to teach programming such as Chris Roffey, Al Sweigart and Sentdex along with the wider CAS and Facebook community is also a great source of inspiration. To all of the aforementioned, I am indebted. You have given me the confidence to keep developing my programming skills independently and to eventually share these skills with you on CAS, Facebook, Youtube and in my books. All of these brilliant teachers and programmers read early drafts of this book and their comments have improved the book significantly.
A Little Book About Safety
I hope that my compromise of including procedures as well as nonmodular programs is forgiven. I have to be realistic and acknowledge that for all novices, writing programs without subroutines is a starting point and an achievement in itself. There are many solutions to a given algorithm and provided that the output is correct and the algorithm is reasonably efficient, we should recognise these as correct up to GCSE level even if subroutines are not used. They have supported me with their time, patience and agreeable responses to my occasionally unreasonable demands! I also thank the students at CFBS whose hard work have provided me with further motivation to improve my teaching.
Our students always inspire us to be better.
To Suki, Zi and Q, this book would not be possible without you. Have you ever wanted to become more fluent at Python programming? Perhaps you find the prospect of file writing or using 2D data structures daunting? If so, then this is the book for you! The Little Book of Algorithms concisely presents sixteen problems which computer science students will commonly encounter. These problems are solved efficiently using programs written using Python. However, reading these programs is not enough, so the second half of the book presents you with some challenges so that you can apply what you have learnt.
This book will show you how to write better Python programs and will expose you to the key skills that are required to do well in any programming assignment or exam. The aim of the book is to help students build fluency in their Python programming.
- Hungary - Budapest Guide.
- The Role of SDN in Broadband Networks!
- Elementary linear algebra.
- Imagined Families, Lived Families: Culture and Kinship in Contemporary Japan.
- The Hammered Dulcimer: poems by Lisa Williams (May Swenson Poetry Award Series).
- Learn how to accelerate literacy with Read & Sing Little Books:!
The book would suit students who have already been introd See More. Therefore, to help you develop fluency, I have also written some challenges based on 2 this canon. We have to define functions before we can call use them. It is very similar to the program on page William Lau. With a language disappearing every two weeks and neologisms springing up almost daily, an understanding of the origins and currency of language has never seemed more relevant.
In this charming volume, a narrative history, expert linguist David Crystal proves why the story of language deserves retelling. In animated fashion, Crystal sheds light on the development of unique linguistic styles, the origins of obscure accents, and the search for the first written word. He discusses the plight of endangered languages, as well as successful cases of linguistic revitalization.
A Little Book of Language will reveal the story of language to be a captivating tale for all ages. Tokyo Neighbourhood Guide. What To Do In Asakusa?
What To Do In Shibuya? Neighbourhood Guide Tokyo, Japan. What To Do In Odaiba? Your email address will not be published. This site uses Akismet to reduce spam. Learn how your comment data is processed. Products from Amazon.