Machines with rules

This task is about working out rules for some number machines.
illustration: number machine

  

Numbers get put into a machine and get changed by a rule. There are two parts to each rule.  Each machine has a different rule.
 
For the questions below write in the missing parts of the rule for the machine. The two parts of the first machine have been done for you.

  
Example of number machine with rules times 3 and plus 4

Use the numbers to write the two parts of the rule inside the machine.


a)
 
The machine below has two parts to its rule. 
Use the numbers to write the two parts of the rule inside the machine.

b)
Part 1                   Part 2