Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter a sentence: ");
String sentence = in.nextLine();
String[] words = sentence.split("\\s");
for(String s : words)
System.out.println(s + " -> " + s.length());
}
}
Explanation:
Ask the user to enter a sentence
Get each word in the sentence using split method and put them in words array
Loop through the words. Print each word and number of characters they have using the length method in required format
Answer:
scotus[8]
Explanation:
scotus[8] gives the last name because there are 9 elements stored in scotus array
Answer: AWS CodeCommit
Explanation:
The AWS service that the developers can use to meet the requirements that are illustrated in the question is the AWS CodeCommit.
The AWS CodeCommit is refered to as a fully-managed source control service which can be used in the hosting of Git-based repositories which are secure.
AWS CodeCommit makes it easy for the collaboration on code for teams in a secure ecosystem. CodeCommit can securely store binaries, source code etc.
Answer:
void print2(int row) {
for (int i = 0; i < row; i++) {
char ch = 'a';
char print = ch;
for (int j = 0; j <= i; j++) {
cout << print++;
}
cout << endl;
}
}
int count_digits(int num) {
int count = 0;
int temp = num;
while (temp != 0) {
temp = temp / 10;
count++;
}
return (num % count);
}
Explanation: