Which answer best summarizes each line of code of the two followings - ProProfs Discuss
Cancel
TopicsDown
Products Down
Follow Us:
FacebookTwitter
Advertisement

Which answer best summarizes each line of code of the two followings if statements?
string name1, name2;
int guess, answer;
if (name1.equals(name2))
if (guess == answer)



A. The first if statement will compare the numerical value of the two names entered to see if they are equal and the second if statement will also compare the numerical values to see if they are equal
B. The first if statement will not work correctly due to string values being used, the second if statement will correctly compare the variables guess and answer
C. The first if statement will compare the two string values to see if they are equal and the second will compare the two integer values to see if they are equal.
D. The first if statement should read if (name1 == name2) in order to properly compare the values and the second if statement will compare the numerical values to see if they are equal.

This question is part of Computer Programming II Exam (Multiple Choice)
Asked by Justinsmith, Last updated: Sep 09, 2020

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

John Adney

John Adney

John Adney
John Adney

Answered Jan 26, 2017

Compiler Error you fucktards
upvote downvote
Reply 

John Adney

John Adney

John Adney
John Adney

Answered Jan 26, 2017

The "S" in string should be capital and the variables should be initialised. The program will not compile if you write it like that. Therefore the answer is none of the above.
upvote downvote
Reply 

John Smith

John Smith

John Smith
John Smith

Answered Dec 02, 2016

The first if statement will compare the two string values to see if they are equal and the second will compare the two integer values to see if they are equal.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.