Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

What code does the computer run if File_Exists = false? (Select the best answer.) if (File_Exists == true) { getData ( ); } else { sendEmail ( ); } A) getData ( ); B) sendEmail ( ); C) Both sendEmail ( ); and getData ( ); D)The computer doesn't run any code.

OpenStudy (anonymous):

B

OpenStudy (anonymous):

B

OpenStudy (jagatuba):

chr34, it would probably be beneficial to you if someone would explain to you why the answer is B would it not? When you use an if/else clause in a program you are telling the computer that "if a certain condition exits do one thing and if it doesn't exist do something else" So in your example, the code says "if File_Exists is true then execute the detData() method, but (else) if File_Exists is false execute the sendEmail() method". Since the question is asking what happens when File_Exists == (is) false then that means the sendEmail() method will execute (answer B).

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!