Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Uppercase Even Words | String Advanced
Java Classes and Core Mechanics
セクション 3.  3
single

single

bookChallenge: Uppercase Even Words

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Your task is to convert each word at an even position to uppercase and return the modified string.

  1. Split the input string into an array of words using the split(" ") method from the String class.
  2. Create an object for building the result string step by step using the StringBuilder class.
  3. Loop through all elements of the array.
  4. Inside the loop, check if the index is even using the remainder operator % with 2.
  5. If the index is even, convert the corresponding word to uppercase using the toUpperCase() method.
  6. If the index is odd, append the word as is.
  7. After the loop, convert the result to a string using the toString() method.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  3
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt