The following code is supposed to output the string in lowercase letters but it has an error. What is wrong?
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Concepts Of Programming Languages
Java: An Introduction to Problem Solving and Programming (7th Edition)
Problem Solving with C++ (10th Edition)
Java How To Program (Early Objects)
Starting Out with Python (3rd Edition)
- What is the output of the following code if the user enters first as John and second as john? #include<string>arrow_forwardWhat is the output of the following code?Dim strPhrase As StringstrPhrase = "Shut the front door please"lblResult.Text= "Count =" & strPhrase.Lengtharrow_forwardDeclare a string variable containing the word “TEST” repeated 500 times.arrow_forward
- The method lower() returns a string with all the characters converted to lowercase. True or Falsearrow_forwardWhat is the output of the following code: int main() { test1(); test1(); return 0; } void test1 () { static int x=2; int y = 8; cout<<x<<" "<<y<<endl; x+=2; y++; }arrow_forwardWhat is the output of the following code? public class Loopy {public static void main(String[] args) {int x = 1;System.out.println("Before the loop");while (x < 4) {System.out.println("In the loop");System.out.println("Value of x is " + x);x = x + 1;}System.out.println("This is after the loop");}}arrow_forward
- What is the output of the following code? int num = 12;while (num >= 0){if (num % 5 == 0)break;cout << num << " ";num = num - 2;}cout << endl;arrow_forwardThis method will return a string that when printed out will display a triangle. Each row of the triangle will have the next letter from the input argument as the last letter in the row. If the next letter is the noPrint char, * will print out instead of letters for the row. Can’t cannot use System.out.println to print the calculated result in the method. You return itarrow_forwardcorrect the code and and identify the name of error in the below code? String number = “1”; switch ( number ) { case 1: System.out.println( "The number is 1" ); break; case 2: System.out.println( "The number is 2" ); break; default: System.out.println( "The number is not 1 or 2" ); break; }arrow_forward
- What is the output of the following code segment?inte=5,f=10;if(eff0) Write(Red); else Write(Orange);Â a. Red b. Orange c. RedOrange d. nothingarrow_forwardThis method will return a string that when printed out will display a triangle. Each row of the triangle will have the next letter from the input argument as the last letter in the row. If the next letter is the noPrint char, * will print out instead of letters for the row. Can’t use System.out.println to print the calculated result in the method. You return itarrow_forwardWrite a method that counts the number of letters ina string using the following header:public static int countLetters(String s)Write a test program that prompts the user to enter a string and displays the numberof letters in the string.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,