-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDay23_prob2.java
49 lines (38 loc) · 1.19 KB
/
Day23_prob2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Write a program to print the names of students by creating a Student class. If instead of name some other data type is passed then the name should be "Unknown", otherwise the name should be equal to the String value passed while creating object of Student class.
Input Format
Rahul 33
Constraints
Use constructor with argument to initialize the name
Create an object with name to print the name of the student
Pass Two inputs such as one is name and the other with different data type
Output Format
Rahul Unknown
Sample Input 0
Rahul
33
Sample Output 0
Rahul
Unknown
*/
// kirtan jain
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner in = new Scanner(System.in);
String s1 =in.nextLine();
String s2 =in.nextLine();
if((s1.toUpperCase()).equals(s1.toLowerCase()))
{
s1 = "Unknown";
}
if((s2.toUpperCase()).equals(s2.toLowerCase()))
{
s2 = "Unknown";
}
System.out.println(s1);
System.out.println(s2);
}
}