Which answer best summarizes each line of code of the two followings - ProProfs Discuss
Topics
Products
Follow Us:

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: Mar 30, 2020

+ Answer
Request

3 Answers

John Adney

John Adney

Answered Jan 26, 2017

Compiler Error you fucktards
 

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.
 

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.
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

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