-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPractice_Set_4.java
More file actions
91 lines (82 loc) · 3.14 KB
/
Practice_Set_4.java
File metadata and controls
91 lines (82 loc) · 3.14 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package com.company;
import java.util.Scanner;
public class Practice_Set_4 {
public static void main(String[] args) {
//Problem 1:
/* Scanner sc = new Scanner(System.in);
System.out.print("Tell marks in English : ");
float eng = sc.nextInt();
float answer = ((eng*100)/100);
if (answer < 33){
System.out.println("you failed in the exam");
}else{
System.out.print("Tell marks in Maths : ");
float maths = sc.nextInt();
answer = 0;
answer = ((maths *100)/100);
if (answer < 33){
System.out.println("you failed in the exam");
}else {
System.out.print("Tell marks in SST : ");
float SST= sc.nextInt();
answer = 0;
answer = ((SST *100)/100);
if (answer < 33){
System.out.println("you failed in the exam");
}else {
answer = (((SST+maths+eng)*100))/300;
System.out.println("You are promoted to next class your percentage is : " + answer);
}
}
}*/
//Problem 2:
/* Scanner sc = new Scanner(System.in);
System.out.print("Tell you income in lakhs : ");
float lakhs = sc.nextFloat();
if ((lakhs >= 250000) && (lakhs <= 500000)){
float answer = (5 * lakhs)/100;
System.out.println("You have to pay : " + answer);
}else if ((lakhs >= 500000) && (lakhs <= 1000000)){
float answer = (20 * lakhs)/100;
System.out.println("You have to pay : " + answer);
}else {
float answer = (30 * lakhs)/100;
System.out.println("You have to pay : " + answer);
}*/
//Problem 3 :
/* Scanner sc = new Scanner(System.in);
System.out.print("Write Day number here : ");
int number = sc.nextInt();
String days[];
days = new String[8];
days[0] = new String("none");
days[1] = new String("monday");
days[2] = new String("tuesday");
days[3] = new String("wednesday");
days[4] = new String("thursday");
days[5] = new String("friday");
days[6] = new String("saturday");
days[7] = new String("sunday");
System.out.println(days[number]);*/
//Problem 4
/* Scanner sc = new Scanner(System.in);
System.out.print("Type year here : ");
int year = sc.nextInt();
if (year%4 == 0){
System.out.println("This year is a leap year");
}else {
System.out.println("This year is not a leap year");
}*/
//Problem 5
Scanner sc = new Scanner(System.in);
System.out.print("Write your link here : ");
String link = sc.nextLine();
if (link.endsWith(".org")){
System.out.println("It is a organisation website");
}else if( (link.endsWith(".com"))){
System.out.println("It is a commercial website");
}else if( (link.endsWith(".in"))){
System.out.println("It is a Indian website");
}
}
}