Java
Given the String variable str, write an expression that evaluates to the character at index 0 of str.
LANGUAGE: JAVA CHALLENGE: Given the String variable str, write an expression that evaluates to the character at index 0 of str.
Read MoreWrite an expression whose value is the number of characters in the following String : “CRAZY!\n\\\t\\\\\\\\\\n. . . .\\ \\\r\007’\\’\”TOOMUCH!”
LANGUAGE: JAVA CHALLENGE: Write an expression whose value is the number of characters in the following String : “CRAZY!\n\\\t\\\\\\\\\\n. . . .\\ \\\r\007’\\’\”TOOMUCH!” Suggestion: copy/paste the above String into your code– it’s too crazy to try to copy it by typing.
Read MoreGiven a String variable named sentence that has been initialized, write an expression whose value is the index of the very last character in the String referred to by sentence.
LANGUAGE: JAVA CHALLENGE: Given a String variable named sentence that has been initialized, write an expression whose value is the index of the very last character in the String referred to by sentence.
Read MoreGiven a String variable named sentence that has been initialized, write an expression whose value is the number of characters in the String referred to by sentence.
LANGUAGE: JAVA CHALLENGE: Given a String variable named sentence that has been initialized, write an expression whose value is the number of characters in the String referred to by sentence.
Read MoreWrite an expression that concatenates the String variable suffix onto the end of the String variable prefix.
LANGUAGE: JAVA CHALLENGE: Write an expression that concatenates the String variable suffix onto the end of the String variable prefix.
Read Morewrite an expression whose value is the values of each these variables joined by a newline character. So if gold, silver, and bronze, had the values “Arakawa”, “Cohen”, and “Slutskaya”, the expression, if it were printed would have the names “Arakawa”, “Cohen”, and “Slutskaya” each appearing on a separate line.
LANGUAGE: JAVA CHALLENGE: Given three String variables that have been declared and given values, gold, silver, and bronze, write an expression whose value is the values of each these variables joined by a newline character. So if gold, silver, and bronze, had the values “Arakawa”, “Cohen”, and “Slutskaya”, the expression, if it were printed would have the names “Arakawa”, “Cohen”, and “Slutskaya”…
Read MoreGiven a String variable word, write a String expression that parenthesizes the value of word. So, if word contains “sadly”, the value of the expression would be the String “(sadly)”
LANGUAGE: JAVA CHALLENGE: Given a String variable word, write a String expression that parenthesizes the value of word. So, if word contains “sadly”, the value of the expression would be the String “(sadly)”
Read Morewrite an expression whose value is the values of each these variables joined by a single space. So if firstName, middleName, and lastName, had the values “Big”, “Bill”, and “Broonzy”, the expression’s value would be “Big Bill Broonzy”.
LANGUAGE: JAVA CHALLENGE: Given three String variables that have been declared and given values, firstName, middleName, and lastName, write an expression whose value is the values of each these variables joined by a single space. So if firstName, middleName, and lastName, had the values “Big”, “Bill”, and “Broonzy”, the expression’s value would be “Big Bill Broonzy”. Alternatively, if…
Read Morewrite a String expression whose value is the String equivalent of each these variables joined by a single period (.) So if octet1, octet2, octet3, and octet4, had the values 129, 42, 26, and 212 the expression’s value would be “129.42.26.212”.
LANGUAGE: JAVA CHALLENGE: Given four int variables that have been declared and given values, octet1, octet2, octet3, and octet4, write a String expression whose value is the String equivalent of each these variables joined by a single period (.) So if octet1, octet2, octet3, and octet4, had the values 129, 42, 26, and 212 the expression’s value would be “129.42.26.212”. Alternatively, if octet1,…
Read Morewrite a String expression whose value is the String equivalent of each these variables joined by a single hyphen (-) So if areaCode, exchange, and lastFour, had the values 800, 555, and 1212, the expression’s value would be “800-555-1212”.
LANGUAGE: JAVA CHALLENGE: Given three int variables that have been declared and given values, areaCode, exchange, and lastFour, write a String expression whose value is the String equivalent of each these variables joined by a single hyphen (-) So if areaCode, exchange, and lastFour, had the values 800, 555, and 1212, the expression’s value would be “800-555-1212”. Alternatively, if…
Read Morewrite a String expression consisting of the string “http://” concatenated with the variable’s String value. So, if the variable refers to “www.turingscraft.com”, the value of the expression would be “http://www.turingscraft.com”.
LANGUAGE: JAVA CHALLENGE: Given a String variable address, write a String expression consisting of the string “http://” concatenated with the variable’s String value. So, if the variable refers to “www.turingscraft.com”, the value of the expression would be “http://www.turingscraft.com”.
Read MoreDeclare a String variable named oneSpace, and initialize it to a String consisting of a single space.
LANGUAGE: JAVA CHALLENGE: Declare a String variable named oneSpace, and initialize it to a String consisting of a single space.
Read More