Jibran Barakat
[Type the document subtitle]
[Pick the date]
Jbarakatcontrol
Contents
Initial investigation 2
Flowchart 2
Experimentation 5
Task a 9
Task B 14
Improving code 19
Task 3 21
Bibliography 22
Initial investigation
The task consists of generating a program which asks the user 10 mathematical questions. Using in each case any two numbers and addition, subtraction or multiplication. The finale score out of 10 should also be outputted at the end.
In addition to this I the program would need to ask the student for their class and then save their score data. Furthermore the results need to be organised by the last 3 results of the students, sorted in: alphabetical order with the users highest score, by the user’s highest scores highest – lowest and finally
…show more content…
by the average of the 3 results, sorted by highest to lowest. Before embarking on the coding, I would need to plan the code. To start with the functions I would need working would be: • Print function – to print user name, questions, responses etc • Random function – to allow random selection of integers as well as mathematical functions • Variables – to store users name, class, score, and question count • A writefile method – to store the results • A readfile method – to read the results • A filesort method – to sort the results in alphabetical order etc Flowchart After identifying my requirements this is a flowchart of my process of app creation: Experimentation After planning the method for creating my application I decided to begin experimentation in order to implement my desired functions effectively.
The tasks given would require trial and error as well as countless debugging – mainly due to the advanced functions needed such as file organisation.
One of the main functions I will be using is variables, and so I needed to test how they worked.
This would allow me to save the score of the user, question count, the correct answer and the users input.
Furthermore I paired the variables with a print function which would allow me to show the user questions and variables.
Next I would need to find a method of adding a random integer variable, as well as an operator.
As I had no prior knowledge to this, I completed a quick google search for my query.
After which I found a site called “stackoverflow”1 which a user wanted a method of generating a random integer between 0 – 9. A reply from another user led to the python documentation 2 which I decided to look for to gain more information.
It stated I needed to import the “random” class and use the random.randint method for to generate a random interger.
random.randint(a,
b)¶ Return a random integer N such that a <= b. Alias for randrange(a, b+1). A and b would be my minimum and maximum integers. I decided to test this using PythonIdle I had an issue in which once the random integer was assigned, it would not re-generate a random integer. The solution to this would be to use a loop – and inside the loop would be the random number variables being re-assigned each time the loop ran. To introduce this loop I would need to research it. In my program the loop would continue to run until the “count” variable reached 10 (as each question answered would add 1 to the count variable) Another google search led me to a site called tutorialspoint3 This site taught me the correct syntax for a while loop, and so I decided to implement it, and then pair it with my random integer function. In my real implementation I would have incorporated an “if” statement in the loop – which checks the mathematical operator for what it is, and alters the answer depending on it. I returned to stackoverflow and found an example of how to implement the random operator variable4. The code itself would set a variable and in that variable there would be a list of mathematical operators, then using the random.choice function a random item from the list would be selected. The code debugged worked successfully. The knowledge gained via this experimentation was enough to begin construction of my code. Task a Task a would require a computer program built for a primary school teacher to test the basic arithmetic skills of their students. The program itself should generate a quiz consisting of a series of random integers, and in any case any two numbers and addition, subtraction and multiplication. The program should ask for the students name and then ask 10 questions – outputting the result of the answer. Finally the program should output the final score out of 10. Using psedocode the way the program should function should be: Set variable name to input “what is your name” Print “ok” and name variable Initialise count variable to 0 Initialise score variable to 0 Start loop while count variable is less than 10 Initialise number1 variable to a random integer between 1-10 Initialise number2 variable to a random integer between 1-10 Initialise randomoperator variable to a random integer of multiplication, addition or subtraction Print “what is” and number1 and randomoperator and number2 Set useranswer variable to input Checks if the random operator is multiplication, addition or subtraction Set correctanswer variable multipliying, adding or subtracting the numbers depending on the operator Checks if the useranswer variable is equal to correctanswer variable If so Increment count variable by one Increment score variable by one If not Increment count variable by one Outside of loop Print score variable + “/10” With this knowledge I decided to begin coding. I decided to add an experimental loop which would check the operator list for which operator was selected, and according to that set the answer variable to the first random integer, summed via the selected operator with the second random integer The final section of task 1 would be to produce a final score out of 10. This would be extremely simple. The method of doing this would be by adding a print function once the loop ends, outputting a string of “your score was” in addition to the score variable and “/10”. As my score variable only increments once an answer was correct it would be extremely efficient. Task B After successfully completing task 1, I needed to move on to task 2. This task would require me to store the data of the user, as well as their class. In addition to this the class data would need to be kept separately. The psedocode for this task would be: Using my prior python knowledge from codecademy5 I knew an easy and efficient method would be creating a file. The filename would be the class name, and inside the file the name and score would be stored. To begin, I simply implemented another variable called “Class” after the program asks for the user’s name, which would prompt the user “what is your class” and store their input. It was placed outside of the loop, just like asking the name due to the fact that it does not need to be asked more than once. I then set a variable called “classfilename” which would be the filename of the class (gained from the “Class” variable) of the user and its file format (in this case a text file). As the task required a method of saving and reading files I looked at the pythonforbeginners6 website, which told me how to write, open and read files. The first step in doing this was checking if the filename (classfilename) exists, and if so add data to the file, however if the file name does not exist it should create the file and add the data. I did a google search which led me once again to stackoverflow. After reading the responses I found as long as I use the open method it would create a new file if the file does not exist. Therefore all I had to do was find the correct method of reading and writing the file. Pythonforbeginners6 taught me the various “modes” for file opening and saving. The mode that suited my function most for writing the file would be “a” for appending. This is due to the fact the file will not have to be read only, as data would need to be added. It would also not be ‘w’ for write only – as this would completely re-write the file for only one result, and as it is a class of students we will need multiple results. This also omits ‘r+’ which is reading and writing. Therefore the correct mode would be ‘a’ for appending. Near the end of the website I found documentation of using a “With statement” – opposed to the normal syntax of opening and saving files, the method “has better exceptions handling” as well as automatically closing the file. I decided this was the method for me. Using the example as a guideline, I adapted the code to be able to be used for my purpose. While testing the code, It worked successfully I then implemented this into my real code. Class 11e Class 11b Improving code The code for the quiz successfully works, however there are a few issues which need to be solved. First of all once all questions were counted, 11 questions were asked instead of the intended 10. After reading my code I had discovered I had initialised the “count” variable to 0, so the user would start of on question 0 opposed to 1. To solve this, I simply changed the count variable initialisation from 0 to 1. The next issue was the user not being able to know what question they were on, and to solve this I added a print statement in the for loop, which told the user “You are on question “as well as their count variable. The count variable would have to be converted to a string, as the print would be printing strings only.
Another thing that I observed and recorded with an a frequency count was Jamie doing several work sheets. One of theses worksheets was a math specifically counting and the other worked on identifying objects that started with the letter R. After the teacher gave instructions on both the papers Jamie started to work on her worksheets. With in the time it took her to finish these worksheets (less then 15 minute) Jamie ask on of the adults if she was doing the work correctly about seven times. One thing that I would modify in the future is the instructions that were given at the beginning. I would make sure that the students understood what they were support to be doing before they started the assignment. I would also be very specific with
1) I believe that my theoretical curves don’t really match like figure 4 but then again it somewhat does. My immigration curve and extinction curve do hit each other once, but not like in figure 4 where they hit each other twice. Also my extinction curve is going up like in figure 4 and my immigration curve is going down just like in figure 4. So I guess you could say that my curves represent the curves on figure 4.
Session one began with me getting to know Jenna. However, this is not my regular student so I had to follow in the footsteps of the future teacher who was paired up with her. However I was able to give her my getting to know you activity as well has an informal assessment in order to gather an understanding of what math level she was at. After she answered questions from both the other future educator as well as my getting to know you activity, we began working on both of our pre assessments with her. It quickly became apparent that her biggest struggle was when it came to fractions. Every fraction question she had left unanswered. Additionally, she struggled with a few division problems and two digit multiplication problems. However, as a
Hope you had a great week, I enjoyed reading your post and agree that we as individuals need to have accountably for our own health and well-being, in particular, making healthier choices. Below you will find my response to this week’s post.
Anchor standard 1: Read closely to determine what the text says explicitly. Cite specific evidence. Draw conclusions.
3. Would it be better to multiply by the size of the frame used to select the random sample?
Well lets see, “ how will I apply the tips I have learned in this week's assignment?” (unit 1 homework) There is a lot of tips and information in the paper I just read. It is all very good information and helpful, I know it will come in handy not only in this assignment but in all my work throughout this program. I learned the different ways people learn and think and how to work at being those kinds of thinkers and apply that to the papers I write. There is a lot of information out there, knowing where to look is very important and knowing how to incorporate your research is a must. Knowing your subject in and out and the proper way to do so is also important, to write a well informed paper. What I have read will help me with that also.
The specified complexity argument states that it is impossible for complex patterns to be developed through random
Describe how you will promote sensitivity to racial, cultural, religious, and ethnic differences in your position.
could have choose it otherwise also, which is not compatible with determinism. This problem is
mean for each question. Keep a record of the responses for each person who participates.
Answer: A random number generator is a computational device which is able to generate a sequence of numbers or symbols that lack any pattern and appear to be random [3]. Ideally, a good random number generator should b...
User steps through a series of questions, and clicks a button to proceed to the next question
Experiments use inquiry skills and methods to make estimates, predictions, gather and analyze data, draw conclusions, and present findings. Examples include texting sink or float objects, growth conditions, and steps needed to create an electrical circuit.
Unrestricted or simple random sampling refers to every member in population has a known and equal chance to be selected as a sample. Researcher had used random number generator at stattrek to know the random numbers to be chosen as a sample. Then researcher had standardized the entire respondents name for both companies by using alphabet to ensure the accuracy of the calculation.