-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmin574.dart
231 lines (194 loc) · 5.54 KB
/
Admin574.dart
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
/*
ROLL NUMBER : 574
NAME : PIYUSH MAKWANA
YEAR/DIV : SYBCA5
*/
import 'dart:io';
void main() {
print("\nChoose Number :");
print("\n1) Check Number is Greater Than or Not ");
print("2) Display Personal Detail ");
print("3) ArithMatic Operations ");
print("4) Check the Type of varible ");
print("5) User Input user Details ");
print("6) Sum of Naturals Number ");
print("7) Simple Interest Using Function");
print("8) Odd Number between 1 to 100 also UserInput");
print("9) find Total and avarage from list ");
print("\n");
int? userInput = int.parse(stdin.readLineSync()!);
switch (userInput) {
case 1:
CheckedNumIsGraterThanOrNot();
break;
case 2:
DisplayPersonalDetail();
break;
case 3:
ArithMeticOperation();
break;
case 4:
CheckingTypeOfvariable();
break;
case 5:
UserInputDetailsOfUsers();
break;
case 6:
SumofNaturalNumberUsingForLoop();
break;
case 7:
FindSimpleIntereset();
break;
case 8:
OddNumberusingWhileLoop();
break;
case 9:
TotalandAvaragefromList();
break;
}
}
CheckedNumIsGraterThanOrNot() {
print("\nEnter the number 1 :");
int? num1 = int.parse(stdin.readLineSync()!);
print("Num1 : $num1\n");
print("Enter the number 2 :");
int? num2 = int.parse(stdin.readLineSync()!);
print("Num2 : $num2\n");
if (num1 > num2) {
print("$num1 is Greater Than $num2");
print("\n");
} else {
print("$num1 is Less Than $num2");
print("\n");
}
}
DisplayPersonalDetail() {
int rno = 574;
String name = "Piyush Makwana";
String email = "mpiyush3510@cbigujarat.onmicrosoft.com";
dynamic mno = "+917990764192";
int div = 5;
// int android=89;
// int java=70;
// int Iot=90;
// int Is1=79;
// int dotnet=92;
print("\nStudent Information");
print("\nRno : $rno");
print("Name : $name");
print("Email : $email");
print("Div : $div");
print("Mobile Number : $mno\n");
// print("----------------------------------------");
// print("Android : $android");
// print("Java : $java");
// print(".Net : $dotnet");
// print("Internet of Things : $Iot");
// print("Information System: $Is1");
// int total;
// total=android+java+Iot+Is1+dotnet;
// print(" \n==> Total = $total");
}
ArithMeticOperation() {
print("Enter the number1 : ");
int? n1 = int.parse(stdin.readLineSync()!);
print("Enter the number2 : ");
int? n2 = int.parse(stdin.readLineSync()!);
print("Which Operation want to perform : ");
print("1. Addition");
print("2. Substraction");
print("3. Multiplication");
print("4. Division");
int? n3 = int.parse(stdin.readLineSync()!);
switch (n3) {
case 1:
print("Addition : ${n1 + n2}");
break;
case 2:
print("Substraction : ${n1 - n2}");
break;
case 3:
print("Multiplication> : ${n1 * n2}");
break;
case 4:
print("Division : ${n1 / n2}");
break;
}
}
CheckingTypeOfvariable() {
var A = 1223;
var B = 46473.554;
var C = "Piyush Makwana";
var D = [1, 2, 3, 4, 5, 66, 7];
var E = {"Name": "piyush", "no": 574};
print("The type of variable A is : ${A.runtimeType}");
print("The type of variable B is : ${B.runtimeType}");
print("The type of variable C is : ${C.runtimeType}");
print("The type of variable D is : ${D.runtimeType}");
print("The type of variable E is : ${E.runtimeType}");
}
UserInputDetailsOfUsers() {
print("\nEnter the First Name :");
String? fname = stdin.readLineSync();
print("\nEnter the Second Name :");
String? sname = stdin.readLineSync();
print("\nEnter the Last Name :");
String? lname = stdin.readLineSync();
print("\nHello ${fname} ! Please Enter Your Email Address : ");
String? email = stdin.readLineSync();
print(
"\nThanks ${lname} for Giving Your email kindly please add Your mobile number below ! ");
int? mno = int.parse(stdin.readLineSync()!);
print("\nYour Name is ${'$fname $sname $lname .'}");
print("Email : $email");
print("Mobile Number : $mno\n");
}
SumofNaturalNumberUsingForLoop() {
print("\nEnter The Number : ");
int? n = int.parse(stdin.readLineSync()!);
int sum = 0;
for (int i = 1; i <= n; i++) {
sum += i;
}
print("sum : $sum");
}
FindSimpleIntereset() {
print("\nEnter the amount :");
int? P = int.parse(stdin.readLineSync()!);
print("Enter the interest rate :");
int? R = int.parse(stdin.readLineSync()!);
print("Enter the number of years :");
int? N = int.parse(stdin.readLineSync()!);
print("\n Simple Interest : ${P * R * N / 100}\n");
}
OddNumberusingWhileLoop() {
print("\nEnter the number (example : 100) = ");
int? number = int.parse(stdin.readLineSync()!);
int n = 0;
print("\n");
while (n < number) {
n += 1;
if (n % 2 == 0) {
print("$n");
}
}
}
TotalandAvaragefromList() {
print("\nEnter the marks of Android : ");
int? Android = int.parse(stdin.readLineSync()!);
print("Enter the marks of Java : ");
int? Java = int.parse(stdin.readLineSync()!);
print("Enter the marks of Iot : ");
int? Iot = int.parse(stdin.readLineSync()!);
print("Enter the marks of Is : ");
int? Is = int.parse(stdin.readLineSync()!);
print("Enter the marks of .Net : ");
int? Dotnet = int.parse(stdin.readLineSync()!);
var Subject = [Android, Java, Iot, Is, Dotnet];
var sum = 0;
Subject.forEach((element) => sum += element);
print("\nList : $Subject");
print("The total of list elements : $sum");
// print("The avarage of list is : ${element / Subject.length}\n");
print("The avarage of list is : ${sum / 5}");
}