Java arrays, conditions and loops
Before you begin this project, you need to be familiar with Java arrays, if statements and for loops.
If you are not familiar with this already, watch the following tutorial within the given time frame:
- Control Flow [1:38:43] to End of For-Each Loop [2:21:58]
It is highly recommended to type and run the code along with the video on any IDE or using an online compiler such as online-java.com.
Write a program that creates a copy of an array but all the short words are replaced with the String "SHORTWORD".
- Copy the code from the project file LongWords.java and paste it in an online java compiler. Change the class name and its references to "Main" to match the file name of the online compiler. Watch this tutorial if you're using an online compiler for the project.
Instead, if you have a code editor and Java installed on your system, download the code (ZIP file). Watch this to learn how to do that.
Instead, if you have git installed, you can clone the repository. - There is only one block of code you need to add. The detailed instructions for the code you need to write are given with 🔴 emoji and the area is marked with ⬇️⬆️ emojis. Do NOT write anything outside these areas.
- Once you are done, run the code in your editor and make sure that your code works correctly and that your output matches the one given below.
- If you used an online compiler, simply create a new file, add your filename (eg: SalmaLongWords.java) and open a pull request.
- Otherwise, if you used an IDE, before submitting, change the name of the file to include your name.
For example:
If your name is Salma, change the name of the file to SalmaLongWords.java - Similarly, change the name of your class (and all its references) to include your name (otherwise, the code will not run in your IDE).
- The create a fork of this repository, submit your file and open a pull request. Watch this to learn how to do that.
Congratulations on completing the project!