What will be the answer of the question? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What will be the answer of the question?

String ____ Country____"USA"_____

26th May 2023, 1:02 PM
Anchal Verma
Anchal Verma - avatar
10 Answers
+ 6
What exactly is the question?
26th May 2023, 1:37 PM
Lisa
Lisa - avatar
+ 5
Read the lesson again and look for a code example that is similar to the one in the task.
26th May 2023, 1:42 PM
Lisa
Lisa - avatar
+ 3
Anchal Verma So ask a question about it. Just seeing the blanks and no context gives zero clue about what's being asked. But pls do not ask for the final answer to the assignment. Fullfilling them is part of the lesson. Ask for information instead.
26th May 2023, 2:02 PM
Emerson Prado
Emerson Prado - avatar
+ 2
Well, here's what we can infer: Line 1: that's gonna be the name of a String variable, obviously. Missing a ; as well, so we can be confident that you're not copying things correctly lol. This sounds flippant, but turns out to be important, because... Line 2: normally a capitalized variable name would be a class name, but since we've already established that you weren't careful about copying things, I'd guess this line is supposed to be assigning a value to the previously declared string variable. This line therefore gives us the string name for line 1, and this time the missing ; might indeed be part of the question. So that gives us all the information we need to fill in the blanks. Hopefully that helped.
26th May 2023, 2:25 PM
Orin Cook
Orin Cook - avatar
+ 1
It is fill in the blanks
26th May 2023, 1:39 PM
Anchal Verma
Anchal Verma - avatar
+ 1
I guess you have to declare string variable read your question again and give more details about it
26th May 2023, 4:38 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Anchal Verma here's your free answer: string country; country = "USA"; But I would also suggest to restart the course and your mindset. Programming requires attention to detail and thorough understanding of the concepts and syntax. The first line is variable declaration. country is declared as a string variable. The second line is variable assignment. USA is assigned as the value to the country variable. = is used to indicate assignment. ; is used to terminate every statement in c++. Two lines of codes packed a lot of basic ideas and you're going to use this knowledge over and over again in the future. The fact where you ended up essentially guessing meant you did not really learn the previous lesson. Go slower and test yourself repeatedly. A solid foundation is what you want.
27th May 2023, 11:47 PM
Bob_Li
Bob_Li - avatar
0
I have tried many a times but it was showing wrong answer
26th May 2023, 1:43 PM
Anchal Verma
Anchal Verma - avatar
0
PS: the blank spaces are usually the correct size, so I'd wager the actual question looked like this: String _______; country _ "USA" _
26th May 2023, 2:27 PM
Orin Cook
Orin Cook - avatar
0
Orin Cook Bravo! 👏
30th May 2023, 12:07 PM
Евгений
Евгений - avatar