Note: Download A01.zip before beginning to code your solutions.
Write a program called Picture.java which generates the following picture;

Files to Submit: Picture.java
Write a program called Traffic.java that will create a 1-D board with eight squares
in it, and allow the user to click on the board 6 times.
On the first three clicks a green traffic light is placed on the square that the user clicked on.
As well, each time the user clicks on the board if there was a green light already on the board it turns yellow, if there was a yellow light on the board it turns red, and if there was a red light on the board it is removed.
For instance if the user clicks on the leftmost square the board would be:

Then if the user clicks on the rightmost square, the first light turns from green to yellow, and a green light is placed on the rightmost square:

Note the following:
Files to submit: Traffic.java
Write a program called EmailMaker.java which reads in a person's name and outputs
an email address for that user.
When the program is run, the user will type in their first name, middle name, and last name. The email adress is generated as follows:
For instance, if the user types in their name as: "Harry James Potter" their email address would be:

Note the following:
Files to submit: EmailMaker.java
Write a program called CASGenerator.java which will read in a chemical number and
output the equivilent CAS(Chemical Abstracts Service) number. A CAS number is a standard way
Chemists can identify the many chemicals they need to work with.
Many numbers used to track people and information contain a built in error-checking mechanism. When the number is first generated, the digits of the number are combined in some mathematical fashion to produce an extra "check digit" which is added to the end of the original number. Programs can identify that a number entered is invalid by checking to see if the last digit entered matches what the calculation should produce.
For this exercise you will be performing the CAS check digit calculation. Your program will input a chemical number as an integer from 1000 to 9999 (ie. 4 digits long), calculate the CAS check digit, and then output the new five digit CAS number.
The CAS check digit calculation is as follows. Read carefully. Take the least significant digit of the chemical number and multiply it by 1. Add to that number, the next digit multiplied by 2. Then add to that the next digit multiplied by 3, and so on until all the digits of the chemical number have been used. The check digit is the remainder of the final number that was added up, when divided by 10. (i.e. The addition modulo 10.)
For instance, D-glucose has been assigned a chemical number of 5099. The check digit for this number is found by; (9x1) + (9x2) + (0x3) + (5x4) = 47. Then the remainder of 47 when divided by 10 is the check digit. (i.e. 47 Modulo 10). Thus, the CAS number produced would be 50997.
Note the following:
Files to submit: CASGenerator.java
Marks will be awarded on this and all future assignments for appropriate documentation and program style. The markers will, in particular, be looking at the following:
You will need to submit your assignment electronically just as you did for Assignment 99. Click here to go to the Assignment 1 submission page.
Please submit your solution to each question as you complete it. If you modify your solution later, you can simply submit the new code. It will replace the previous submission. You are strongly advised to attempt to submit the files early, to ensure that you do it successfully. Be sure to follow the instructions to check that your files were submitted.
Required Files:
Picture.javaTraffic.java EmailMaker.java CASGenerator.java