Coding help needed for voltage to work

Hi guys!

I need help with my project as i'm new to arduino and I am in need of help as my teacher has given me a tough question for a newbie. In this diagram, I need to construct a part joining with the arduino I have to measure voltage. I need helps in coding as i'm bad in coding. Please help me if you were to know the answers. I have tried done with a part of the coding, but i am not sure did i do it correctly. Please help me to check if possible

sketch_jun07a.ino (630 Bytes)