Allstate interview question

Basic programming language logical questions