-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask6 (1).java
More file actions
42 lines (27 loc) · 900 Bytes
/
Copy pathTask6 (1).java
File metadata and controls
42 lines (27 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.Scanner;
public class Main{public static void main(String[] args)
{ Scanner obj = new Scanner(System.in);
System.out.println("Enter your Sentence : ");
String sent = obj.nextLine();
int length = sent.length();
char a;
for (int i = 0; i< length ; i++)
{ char character = sent.charAt(i);
if(Character.isUpperCase(character) || sent.lastIndexOf('\\')=='.')
{ System.out.println("The sentence is now beautify");
break;
} else if(Character.isLowerCase(character) || sent.lastIndexOf('\\')!='.')
{ a =Character.toUpperCase(character);
System.out.println(""+a+""+sent.substring(1)+".");
break; } }}}