Question: import java.util.Scanner; import java.util.Random; public class MainClass { public static void main ( String [ ] args ) { / / Task 1 : char

import java.util.Scanner; import java.util.Random; public class MainClass { public static void main(String[] args){// Task 1: char c1='a', c2='3', c3='?', c4=''; System.out.println(/*add your code here*/); // convert c1 to upper case System.out.println(/*add your code here*/); // check if c1 is an upper case System.out.println(/*add your code here*/); // check if c1 is a digit System.out.println(/*add your code here*/); // check if c2 is a digit System.out.println(/*add your code here*/); // check if c2 is a letter System.out.println(/*add your code here*/); // check if c3 is a letter or a digit System.out.println(/*add your code here*/); // check if c3 is a special character //------------------------------------------------------------------------// Task 2: String sentence ="The internationalization of intergovernmental organizations necessitates comprehensive and meticulously detailed documentation"; // Q1:what is the length of sentence System.out.println(/*add your code here*/); // Q2: write a java code snippet to determine and print the number of words in sentence variable /*add your code here*/// Q3: print the index of the first z character in sentence System.out.println(/*add your code here*/); // Q4: what character is at index 33 System.out.println(/*add your code here*/); // Q5: does sentence end with "ion"? System.out.println(/*add your code here*/); // Q6: does sentence start with with "the"? System.out.println(/*add your code here*/); // Q7: extract "internationalization of intergovernmental" from sentence, store it in a variable and print it /*add your code here*///------------------------------------------------------------------------// Task 3: String name1="Adam"; String name2="adam"; // compare the content of name1 & name2(case sensitive & not case sensitive) System.out.println(/*add your code here*/); // case sensitive System.out.println(/*add your code here*/); // not case sensitive //------------------------------------------------------------------------// Task 4: int num1=12; double num2=12.00009; // convert num1 and num2 to strings and store the strings into 2 String variables, after that print the string variables /*add your code here*///------------------------------------------------------------------------// Task 5: // Q1: create a stringBuilder object and initilize it with your full name /*add your code here*/// Q2: what is the size (length "how many characters") of the stringBuilder object // Q3: what is the capacity of the stringBuilder object // Q4: add your id number to your name stored in the stringBuilder object // Q5: explain what is the different between the size(length) of a string builder and the capacity System.out.println(/*add your code here*/); //------------------------------------------------------------------------}}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!