Answer:
// name of the package
package stringlength;
// Scanner is imported but it is not needed
// So it is commented
// import java.util.Scanner;
// The class name StringLength is defined
public class StringLength {
// main method to signify the beginning of program execution
public static void main(String[] args) {
// if-statement to check if argument is supplied to
// command line
if(args.length > -1) {
// the first argument is read and assigned to input
String input = args[0];
int length = input.length(); // using length() method in String class
System.out.println("Your string has a length of "+length+" characters.");
} else {
System.out.println("Please enter your string argument in quote");
}
}
}
Explanation:
The code works fine with little modification and comments. The user should supply the string arguments in quote. The quote must surround the strings because our logic read the first argument passed to the command line. Inserting a string with space between them will provide a wrong output.
A sample image is attached.
Answer:
the 3 parts of a function are as follows
1. name
2. return
3.void
are what you plan to achieve by the end of your project.
Explanation:
This might include deliverables and assets, or more intangible objectives like increasing productivity or motivation. Your project objectives should be attainable, time-bound, specific goals you can measure at the end of your project.
statement that describes the “what” of your project. The tangible and measurable “what”. The “what” that's achievable, realistic, and can be completed within the time allowed. These statements ladder up to the goals of the project, providing stepping stones to project success.
<h3>:) CARRYINGTOLEARN</h3>
Answer
program that, after being initially loaded into the computer by a boot program, manages all of the other application programs in a computer. The application programs make use of the operating system by making requests for services through a defined application program interface (API). In addition, users can interact directly with the operating system through a user interface such as a command line or a graphical user interface