• Register
0 votes
90 views

Problem:

Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not?
Write an expression that whose value is the fifth character of the String name?
7 5 3
5,380 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

The correct answer is: name.charAt(4)
  
Hope this might help you.
8 6 2
10,530 points

Related questions

0 votes
1 answer 132 views
132 views
Problem: Write an expression whose value is the str that consists of the third to last character of the str associated with s I tried s[2:] didn't work. Can you please guide me with right solution?
asked Feb 19, 2020 maddi86 5.4k points
0 votes
1 answer 113 views
113 views
Solutions: I am new in programming and my logic is not good, can anyone give the right solution? Write an expression that evaluates to true if and only if the C-string s equals the C-string "end"?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 189 views
189 views
Problem: I am new in programming and stuck in a query, can anyone guide me? Write an expression that evaluates to True if the str associated with s starts with "p"?
asked Feb 17, 2020 maddi86 5.4k points
0 votes
2 answers 84 views
84 views
Problem: I am new in programming, I need help, can anyone help me? Declare an integer constant, MONTHS_IN_YEAR, whose value is 12?
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 43 views
43 views
Problem: Hi there! I am new to the world of programming. My programming teacher gave me an assignment in which I have to write a program in which there would be a function that will take two strings as input from user and will compare the size of both strings ... the larger string of the two. I have no clue how to do that. Please provide me with the sample program with proper description. Thanks
asked Nov 25, 2020 Code Learner 6k points
0 votes
1 answer 3 views
3 views
Problem: I have recently learned about the functions in C++ and I want to write a function that has three string parameters and returns the smallest string of all according to its length. How can I do that? This question might seem nonsense so I apologize for being so dumb. Thanks!
asked 2 days ago Code Learner 6k points
0 votes
2 answers 321 views
321 views
Problem: I am new to programming, so need query to get query to return max number from 3 integer? Write the definition of a method max that has three int parameters and returns the largest? Can anyone guide with correct code?
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 8 views
8 views
Problem: Would the following code be correct? class Person { private: string name; bool sex; int age; public: Person (); bool getSexo (); int getAge (); Person play (string s); }Hope someone could help me out?
asked Jan 25 sasha 13.2k points
0 votes
1 answer 81 views
81 views
Problems: Can anyone give the right solution? Write a literal representing the false value?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 9 views
9 views
Problem: Hi there! I am working with While loop in C++ and I want to write a program that continues to bid unless the user enters ‘n’ or ‘N’. I understand the while loop but unable to make the logic. Please provide me the code with detailed comments. Thank You!
asked 4 days ago Code Learner 6k points