Evaluation: 65%
Showing posts with label Coding (ICS3U). Show all posts
Showing posts with label Coding (ICS3U). Show all posts
Friday, 6 June 2014
Coding: Quiz #3
On this handwritten, closed-book quiz, I did not succeed very well. I didn't do too well since I misunderstood how Switch blocks function.
Labels:
11e année,
Coding (ICS3U)
Monday, 26 May 2014
Coding: Assignment #3
The third assignment has to do with reverse engineering and code enhancement. You have to take an existing program, understand it and add enhancements to it. Third Assignment Due May 26rd.
I have given you a banking program that takes only 2 customers and allows each user to have passwords that are 4 characters long. Extend it to do the following.
1. Change the code so that the bank can have 10 customers.
2. The password is 6 characters long and has at least one of the following (capital letters, small letters, numbers and special characters which are ~!@#$%\^&*()\-_=+\|\[{\]};:'", <.>/?
3. Add a short comments to each logical code block. e.g if statement
4. Comment each of the try-catch blocks.
5. Change the programme to be Bank + your initials. eg. mine would be BankEB.java
5. Write the list of requirements of the program.
a) This bank has X numbers,
b) Each customer has Y accounts,
c) The bank gives each customer z dollars when they open an account etc..
d) Passwords have to be h length and must contain a, b, c,
=============
Evaluation:
Good introductory comment at the top of the program.
Good comments for each block.
One problem:
1) A weak 5 character password is rejected but a weak 6 character password is accepted. See yellow the highlighted text below.
9 out of 10.
=============
Would you like to do some banking? (y)es or (n)o?
y
Who are you?
eb
Could not find you in our database. We are currently opening some new accounts for you.
Guess what! We opened 2 new accounts for you with $100 in each!
Now you need to create a PIN. It must be of a length of 6 characters. Please enter a PIN now
qwert
You need 6 characters.
Invalid response. Deleting accounts. Goodbye
Would you like to do some banking? (y)es or (n)o?
y
Who are you?
ew
Could not find you in our database. We are currently opening some new accounts for you.
Guess what! We opened 2 new accounts for you with $100 in each!
Now you need to create a PIN. It must be of a length of 6 characters. Please enter a PIN now
qwerty
You should include capitals.
Welcome to BankDJ.ew
Would you like to (1) deposit, (2) withdraw, (3) transfer, (4) check balances, (5) finish
5
Would you like to do some banking? (y)es or (n)o?
y
Who are you?
ea
Could not find you in our database. We are currently opening some new accounts for you.
Guess what! We opened 2 new accounts for you with $100 in each!
Now you need to create a PIN. It must be of a length of 6 characters. Please enter a PIN now
Q!1wer
Accepted. A very strong PIN
Welcome to BankDJ.ea
Would you like to (1) deposit, (2) withdraw, (3) transfer, (4) check balances, (5) finish
Labels:
11e année,
Coding (ICS3U)
Coding: Khan Academy - SpinOffs
To help with learning coding our teacher gives us homework on Khan Academy. This way we are learning Java in Eclipse as well as JavaScript. We are learning both in a visual and entertaining way, always getting more difficult by the assignment (for me at least). The following link is to what Khan academy calls "Spin-off". They are my saved work or tutorial videos which I refer to. They show the progress which I have made, to my teacher who monitors.
https://www.khanacademy.org/profile/Greenpop/programs
https://www.khanacademy.org/profile/Greenpop/programs
Labels:
11e année,
Coding (ICS3U)
Friday, 16 May 2014
Tuesday, 29 April 2014
Coding: Bank Assignment #2
Second Assignment Due April 25th.
Save a copy of your first banking example and add extend it for the second assignment.
Save a copy of your first banking example and add extend it for the second assignment.
The bank still has one customer but the customer can have at least two accounts. In addition to being able to withdraw and deposit money the customer can also transfer funds from one account to another. The customer can also have a line of credit account.
I would like you to use methods (also called functions or routines) in your code.
You can review the slide pack called Introduction_to_Methods_revised.pdf. We have gone through the slides on March 24th. The copy from April 4th has some revision.
You can review the slide pack called Introduction_to_Methods_revised.pdf. We have gone through the slides on March 24th. The copy from April 4th has some revision.
Or you can watch a youtube video at the following link.https://www.youtube.com/watch?v=7MBgaF8wXls&list=PLFE2CE09D83EE3E28 Watch Tutorials 15 and 16.
Additional notes
- comment your code.
- Give the proper feed back to the customer. e.g if he/she withdraws money and there is insufficient funds, inform the customer.
- Think of error scenarios. e.g invalid input.
- No need to hand in flowcharts.
- Due on April 25th
- If you finish before April 25th, add the functionality to handle two customers.
Screenshot of a section of my code:
Evaluation:
Feed back
A few bugs in the logic so that performing the same operation twice prints out an error message and then the program recovers.
-good attempt to use multiple methods. (although that's where the bug was introduced too)
-good job recognizing that you can put common code into methods so that it isn't duplicated unnecessarily.
-no exception handling, so non-integer input results in program termination. (I did not take mark off for this)
A few bugs in the logic so that performing the same operation twice prints out an error message and then the program recovers.
-good attempt to use multiple methods. (although that's where the bug was introduced too)
-good job recognizing that you can put common code into methods so that it isn't duplicated unnecessarily.
-no exception handling, so non-integer input results in program termination. (I did not take mark off for this)
Mark 8 out of 10. -2
Well done!
Labels:
11e année,
Coding (ICS3U)
Friday, 25 April 2014
Coding: Quiz 1
Quiz:
There are four questions and each are worth 25%.
You have two hours to do the quiz. Plan your time accordingly.
It is open book. You may use the following to help you.
1) programs you have written previously.
2) the internet (for examples, to look up conversion formulas etc.)
3) all course notes on the wiki page.
4) khan academy (your programs and/or videos)
You may not discuss your with each other.
1) Write a program that outputs the following patterns. Use at least one loop.
a.)
*
**
***
****
*****
b.)
++++1
+++22
++333
+4444
55555
=====================
2. Write a program that
1) Asks the user if they want to convert miles to kilometres or kilometres to miles.
2) Reads the input and does the conversion.
3) Prints the result to the screen.
=====================
3. Write a program that
1) Asks the user if they want to convert pounds to kilograms or kilograms to pounds.
2) Reads the input and does the conversion.
3) Prints the result to the screen.
=====================
4. Write a program that
1) Asks the user for a number between 1 and 512.
2) Print out the multiples of that number up to 12.
e.g.
Enter a number
512
0 * 512 = 0
1 * 512 = 512
2 * 512 = 1024
.
.
.
12 * 512 = 6144
Evaluation:
1.
*, **, ***, ****, *****
[4] is +5
[3] is +4
[2] is +3
[1] is +2
[0] is +1
2. Correct. Nice precision!
3. Correct. Nice precision!
4. Correct.
Mark 16 out of 20. Well done!
Question 1a -1 Using one System.out.println for each would do the job.
Question 1 b) - 3 desired output was:
++++1
+++22
++333
+4444
55555
Labels:
11e année,
Coding (ICS3U)
Monday, 31 March 2014
Coding: Bank Program #1
Screenshot of a section of program:
Evaluation:
Instructions:
Write a program for a simple bank. The bank only has one customer and the customer has only one account. The customer needs to be able to withdraw and deposit money. This is the minimum required.
Remember to
Remember to
- comment your code.
- Give the proper feed back to the customer. e.g if he/she withdraws money and there is insufficient funds, inform the customer.
- Think of error scenarios. e.g invalid input.
Mark 9 out of 10.
-1 because the program did not terminate or give the user an option to terminate.
Well done!
Labels:
11e année,
Coding (ICS3U)
Subscribe to:
Posts (Atom)









