My Samsung galaxy S4 behaving weirdly

I have Samsung galaxy S4, bought it a year ago. It is giving me problems for the last few days, it shows the battery is full and when I turn on the Wi-Fi or the Internet the battery drains suddenly and phone switches off, then after charging it for hours, it restarts but the problem prevails. What should be done?
