Flutter_Assignments
/// Assignment 1 : Write a program to print your profile which contains at least 15 details
// void main() {
// print("Name : Hitesh Kachhela");
// print("phone no : 6355412798");
// print("Adhar No : 5263 4784 1020");
// print("Age : 74");
// print("salary : 4,00,000");
// print("Address : satyam nagar Soc, Opp, firebridged, viramgaam");
// }
/// Assignment 2 : Write a program to declare3 variables of different data types assign values and print
/// all these variables
// void main() {
// int a = 10;
// String b = "Mohit";
// bool c = true;
// double d = 22.4;
// print("${a}\n${b}\n${c}\n${d}");
// }
/// Assignment 3 : Write a program to perform simple calculator (add/sub/mul/div) of two values
import "dart:io";
class Calculator {
void addition(int a, int b) {
var no1 = a;
var no2 = b;
print("Addition is : ${no1 + no2}");
}
void subtraction(int a, int b) {
var no1 = a;
var no2 = b;
print("Subtraction is : ${no1 - no2}");
}
void multiplication(int a, int b) {
var no1 = a;
var no2 = b;
print("Multiplication is : ${no1 * no2}");
}
void division(int a, int b) {
var no1 = a;
var no2 = b;
print("Division is : ${no1 / no2}");
}
}
void main() {
Calculator cal = new Calculator();
print("Please Enter value of No 1 : ");
var no1 = int.parse(stdin.readLineSync()!);
print("Please Enter value of No 2 : ");
var no2 = int.parse(stdin.readLineSync()!);
cal.addition(no1, no2);
cal.subtraction(no1, no2);
cal.multiplication(no1, no2);
cal.division(no1, no2);
}
import "dart:io";
/// Assignment 5 : Write a program to find the area of a rectangle [Area = side 1* side2]
// class Area {
// void areaRectangle(int a, int b) {
// var l = a;
// var b1 = b;
// var area = l * b1;
// print("Area of Rectangle is : ${area}");
// }
// }
// void main() {
// Area area = new Area();
// print("Enter the value of l : ");
// var length = stdin.readLineSync();
// print("Enter the value of b : ");
// var width = stdin.readLineSync();
// area.areaRectangle(int.parse(length!), int.parse(width!));
// }
/// Assignment 6 : Write a program to find the area of a Circle [Area = (Pi)r^2]
// class Circle {
// void areaCircle(double a) {
// var r = a;
// var area = 3.14 * r * r;
// print("Area of Circle is : ${area}");
// }
// }
// void main() {
// Circle circle = new Circle();
// print("Enter the value of R : ");
// var r1 = stdin.readLineSync();
// circle.areaCircle(double.parse(r1!));
// }
/// Assignment 7 : Write a program to find the area of a Triangle [Area = h*b*0.5]
// class Triangle {
// void areaTriangle(double a, double c) {
// var h = a;
// var b = c;
// var area = h * b * 0.5;
// print("Area of Circle is : ${area}");
// }
// }
// void main() {
// Triangle triangle = new Triangle();
// print("Please Enter the value of h : ");
// var h1 = stdin.readLineSync();
// print("Please Enter the value of b : ");
// var b1 = stdin.readLineSync();
// triangle.areaTriangle(double.parse(h1!), double.parse(b1!));
// }
/// Assignment 8 : Write a program to compute Fahrenheit from centigrade [Formula : F=1.8*c+32]
// class Temperature {
// void Fahrenheit(double a) {
// var c = a;
// var Fah = 1.8 * c + 32;
// print("Fahrenheit from centigrade temperature is : ${Fah}");
// }
// }
// void main() {
// Temperature temp = new Temperature();
// print("Please Enter the value of centigrade : ");
// var c1 = stdin.readLineSync();
// temp.Fahrenheit(double.parse(c1!));
// }
/// Assignment 9 : Write a program to swap two values using third variable
// class Swap {
// var temp;
// void swap(double a, double b) {
// temp = a;
// a = b;
// b = temp;
// print("This is the Swaped First Number : ${a}");
// print("This is the Swaped Second Number : ${b}");
// }
// }
// void main() {
// Swap sw = new Swap();
// print("Please Enter the First Number : ");
// var first1 = stdin.readLineSync();
// print("Please Enter the Second Number : ");
// var second1 = stdin.readLineSync();
// sw.swap(double.parse(first1!), double.parse(second1!));
// }
/// Assignment 10 : Write a program to swap two values without using third variable
// class Swap1 {
// void swap1(double a, double b) {
// a = a + b;
// b = a - b;
// a = a - b;
// print("This is the Swaped First Value : ${a}");
// print("This is the Swaped Second Value : ${b}");
// }
// }
// void main() {
// Swap1 sw1 = new Swap1();
// print("Please Enter the First Number : ");
// var first2 = stdin.readLineSync();
// print("Please Enter the Second Number : ");
// var second2 = stdin.readLineSync();
// sw1.swap1(double.parse(first2!), double.parse(second2!));
// }
/// Assignment 11 : Write a program to check the given two numbers are same or not
// class Check {
// void checkNumber(double a, double b) {
// if(a == b) {
// print("Both the numbers are Same!");
// } else {
// print("Both the numbers are not Same!");
// }
// }
// }
// void main() {
// Check check = new Check();
// print("Please Enter the First Number : ");
// var first = stdin.readLineSync();
// print("Please Enter the Second Number : ");
// var second = stdin.readLineSync();
// check.checkNumber(double.parse(first!), double.parse(second!));
// }
/// Assignment 12 : Write a program to check the given number is even or odd
// class EvenOdd {
// void evenOdd(double a) {
// if(a %2 == 0) {
// print("The Number is Even!");
// } else {
// print("The Number is Odd!");
// }
// }
// }
// void main() {
// EvenOdd evenodd = new EvenOdd();
// print("Please Enter the Number : ");
// var check = stdin.readLineSync();
// evenodd.evenOdd(double.parse(check!));
// }
/// Assignment 13 : Write a program to check the given number is positive/negative
// class PosNeg {
// void positiveNegative(double a) {
// if(a >= 0.0) {
// print("Number is Positive!");
// } else {
// print("Number is Negative!");
// }
// }
// }
// void main() {
// PosNeg checkNum = new PosNeg();
// print("Please Enter the Number : ");
// var checknum = stdin.readLineSync();
// checkNum.positiveNegative(double.parse(checknum!));
// }
/// Assignment 14 : Write a program to check the given number is divisible by 3,5 or not
// class Divide {
// void divide(double a) {
// if(a %3 == 0 && a %5 == 0) {
// print("Number is divisible by 3 and 5!");
// } else if(a %3 == 0) {
// print("Number is divisible by 3!");
// } else if(a %5 == 0) {
// print("Number is divisible by 5!");
// } else {
// print("Number is not divisible by 3 and 5!");
// }
// }
// }
// void main() {
// Divide dev = new Divide();
// print("Please Enter the Number : ");
// var div = stdin.readLineSync();
// dev.divide(double.parse(div!));
// }
/// Assignment 15 : Enter 5 subject's mark and calculate the total and percentage.
/// If percentage is less than 35 then Failed else Pass message should be appeared
// class Subject {
// void calculation(double a, double b, double c, double d, double e) {
// var total = a + b + c + d + e;
// print("The Total is : ${total}");
// var percentage = (total * 100)/500;
// print("The Percentage is : ${percentage}");
// if(percentage < 35) {
// print("Student is Failed!");
// } else {
// print("Student is Pass!");
// }
// }
// }
// void main() {
// Subject sub = new Subject();
// print("Enter the First Subject Mark : ");
// var first = stdin.readLineSync();
// print("Enter the Second Subject Mark : ");
// var second = stdin.readLineSync();
// print("Enter the Third Subject Mark : ");
// var third = stdin.readLineSync();
// print("Enter the Fourth Subject Mark : ");
// var fourth = stdin.readLineSync();
// print("Enter the Fifth Subject Mark : ");
// var fifth = stdin.readLineSync();
// sub.calculation(double.parse(first!), double.parse(second!), double.parse(third!),
// double.parse(fourth!), double.parse(fifth!),);
// }
/// Assignment 16 : Write a program to find the maximum number out of three
// class Maximum {
// void maxi(double a, double b, double c) {
// if(a > b && a > c) {
// print("${a} is the greatest OR maximum number!");
// } else if(b > c && b > a) {
// print("${b} is the greatest OR maximum number!");
// } else {
// print("${c} is the greatest OR maximum number!");
// }
// }
// }
// void main() {
// Maximum max = new Maximum();
// print("Please Enter the First Number : ");
// var first = stdin.readLineSync();
// print("Please Enter the Second Number : ");
// var second = stdin.readLineSync();
// print("Please Enter the Third Number : ");
// var third = stdin.readLineSync();
// max.maxi(double.parse(first!), double.parse(second!), double.parse(third!));
// }
/// Assignment 17 : Enter 5 subject's mark and calculate the total and percentage. If percentage is less
/// than 35 then Failed else Grade should be displayed like Second class, First class or Distinction
// class Grade {
// void calculation(double a, double b, double c, double d, double e) {
// var total = a + b + c + d + e;
// print("The Total is : ${total}");
// var percentage = (total * 100)/500;
// print("The percentage is : ${percentage}");
// if(percentage < 35) {
// print("Student is Failed!");
// } else if(percentage > 35 && percentage < 50) {
// print("Student have got Second class!");
// } else if(percentage > 50 && percentage < 70) {
// print("Student have got First class!");
// } else if(percentage > 70) {
// print("Student have got Distinction!");
// } else {
// print("Student was absent!");
// }
// }
// }
// void main() {
// Grade grade = new Grade();
// print("Enter the First subject Marks : ");
// var first = stdin.readLineSync();
// print("Enter the Second subject Marks : ");
// var second = stdin.readLineSync();
// print("Enter the Third subject Marks : ");
// var third = stdin.readLineSync();
// print("Enter the Fourth subject Marks : ");
// var fourth = stdin.readLineSync();
// print("Enter the Fifth subject Marks: ");
// var fifth = stdin.readLineSync();
// grade.calculation(double.parse(first!), double.parse(second!), double.parse(third!),
// double.parse(fourth!), double.parse(fifth!),);
// }
/// Assignment 18 : Write a program to find the number is Positive, Negative or Zero
// class FindNumber {
// void check(double a) {
// if(a > 0) {
// print("Number is Positive!");
// } else if(a < 0) {
// print("Number is Negative!");
// } else {
// print("Number is Zero!");
// }
// }
// }
// void main() {
// FindNumber find = new FindNumber();
// print("Please Enter the Number : ");
// var num = stdin.readLineSync();
// find.check(double.parse(num!));
// }
/// Assignment 19 : Write a program to print between 1 to 10
// void main() {
// for(int i = 1; i<=10; i++) {
// print("This is the Result : ${i}");
// }
// }
/// Assignment 20 : Write a program to add between 1 to 5
// void main() {
// var sum = 0;
// for(int i = 1; i<=5; i++) {
// sum = sum + i;
// }
// print("The Total Sum is : ${sum}");
// }
/// Assignment 21 : Write a program to multiply between 1 to 5
// void main() {
// var mul = 1;
// for(int i = 1; i <= 5; i++) {
// mul = mul * i;
// }
// print("The Total Multiplication is : ${mul}");
// }
/// Assignment 22 : Write a program to print the odd numbers between 3 to 20
// void main() {
// for(int i = 3; i <= 20; i++) {
// if(i %2 == 1) {
// print("This is the Odd Number between 3 to 20 : ${i}");
// }
// } print("\n");
// print("Below are all Even Numbers between 3 to 20 : ");
// for(int j = 3; j <= 20; j++) {
// if(j %2 == 0) {
// print("This is the Even Number between 3 to 20 : ${j}");
// }
// }
// }
///Assignment 23 : Write a program to print the numbers which are divisible by 5 between 3 to 30
// void main() {
// for(int i = 3; i <= 30; i++) {
// if(i %5 == 0) {
// print("This Number is divisible by 5 : ${i}");
// }
// }
// }
///Assignment 24 : Write a program to count the numbers which are divisible by 7 between 1 to 50
// void main() {
// int counter = 0;
// for(int i = 1; i <= 50; i++) {
// if(i %7 == 0) {
// print("This Number is divisible by 7 : ${i}");
// counter ++;
// }
// }
// print("Total numbers which are divisible by 7 between 1 to 50 : ${counter}");
// }
/// Assignment 25 : Write a program to print the following pattern
/// *
/// * *
/// * * *
/// * * * *
/// * * * * *
// void main() {
// for(int i = 1; i <= 5; i++) {
// for(int j = 1; j <= i; j++) {
// stdout.write("* ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 26 : Write a program to print the following pattern:
/// 1
/// 1 2
/// 1 2 3
/// 1 2 3 4
/// 1 2 3 4 5
// void main() {
// print("Enter the Number : ");
// var num = int.parse(stdin.readLineSync()!);
// for(int i = 1; i <= num; i++) {
// for(int j = 1; j <= i; j++) {
// stdout.write("${j} ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 27 : Write a program to print the following pattern:
/// *
/// * *
/// * * *
/// * * * *
/// * * * * *
// void main() {
// print("Enter the Number : ");
// var num1 = int.parse(stdin.readLineSync()!);
// for(int i = 1; i <= num1; i++) {
// for(int space = num1 - 1; space >= i; space--) {
// stdout.write(" ");
// }
// for(int j = 1; j <= i; j++) {
// stdout.write("*");
// }
// stdout.write("\n");
// }
// }
/// Assignment 28 : Write a program to print the following pattern :
/// ***
/// ***
/// ***
// void main() {
// print("Enter the Number : ");
// var nu = int.parse(stdin.readLineSync()!);
// for(int i = 1; i <= nu; i++) {
// for(int j = 1; j <= nu; j++) {
// stdout.write("* ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 29 : Write a program to print the following pattern :
/// * * * * *
/// * * * *
/// * * *
/// * *
/// *
// void main() {
// for(int i = 5; i >= 1; i--) {
// for(int space = 5; space >= i; space--) {
// stdout.write(" ");
// }
// for(int j = 1; j <= i; j++) {
// stdout.write("*");
// }
// stdout.write("\n");
// }
// }
/// Assignment 30 : Write a program to print the following pattern :
/// * * * * *
/// * * * *
/// * * *
/// * *
/// *
// void main() {
// /// Static pattern
// // for(int i = 5; i >= 1; i--) {
// // for(int j = 1; j <= i; j++) {
// // stdout.write("* ");
// // }
// // stdout.write("\n");
// // }
// /// User define pattern
// print("Enter the Number : ");
// var num = int.parse(stdin.readLineSync()!);
// for(int i = num; i >= 1; i--) {
// for(int j = 1; j <= i; j++) {
// stdout.write("* ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 31 : Pattern
/// *
/// * *
/// * * *
/// * * * *
/// * * * * *
// void main() {
// /// Static pattern
// // for(int i = 1; i <= 5; i++) {
// // for(int space = 5; space >= i; space--) {
// // stdout.write(" ");
// // }
// // for(int j = 1; j <= i; j++) {
// // stdout.write("* ");
// // }
// // stdout.write("\n");
// // }
// /// User defined Pattern
// print("Enter the Number : ");
// var number = int.parse(stdin.readLineSync()!);
// for(int i = 1; i <= number; i++) {
// for(int space = number - 1; space >= i; space--) {
// stdout.write(" ");
// }
// for(int j = 1; j <= i; j++) {
// stdout.write("* ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 32 : pattern
/// 1
/// 2 2
/// 3 3 3
/// 4 4 4 4
/// 5 5 5 5 5
// void main() {
// /// Static pattern
// // for(int i = 1; i <= 5; i++) {
// // for(int space = 5; space >= i; space--) {
// // stdout.write(" ");
// // }
// // for(int j = 1; j <= i; j++) {
// // stdout.write("${i} ");
// // }
// // stdout.write("\n");
// // }
// /// User defined pattern
// print("Enter the Number : ");
// var num = int.parse(stdin.readLineSync()!);
// for(int i = 1; i <= num; i++) {
// for(int space = num - 1; space >= i; space--) {
// stdout.write(" ");
// }
// for(int j = 1; j <= i; j++) {
// stdout.write("${i} ");
// }
// stdout.write("\n");
// }
// }
/// Assignment 33 : Write a program to print between 1 to 5 using while loop
// void main() {
// int no = 1;
// while(no<=5) {
// print("${no}");
// no++;
// }
// }
/// Assignment 34 : Write a program to find the sum of digits of a given number
/// METHOD 1 :
// void main() {
// int sum = 0;
// print("Enter the Number : ");
// int n = int.parse(stdin.readLineSync()!);
//
// for(int i = n; i > 0; i = (i/10).floor()) {
// sum = sum + (i % 10);
// }
// print("Sum of digits : ${sum}");
// }
/// METHOD 2 :
/// Follow the below steps to solve the problem:
/// Get the number
/// Declare a variable to store the sum and set it to 0
/// Repeat the next two steps till the number is not 0
/// Get the rightmost digit of the number with help of the remainder ‘%’ operator by dividing it by 10
/// and adding it to the sum.
/// Divide the number by 10 with help of ‘/’ operator to remove the rightmost digit.
/// Print or return the sum
/// Below is the implementation of the above approach:
// void main()
// {
// int sum = 0;
// print("Enter the Number : ");
// var number = int.parse(stdin.readLineSync()!);
// while(number != 0)
// {
// sum = sum + number % 10;
// number = number ~/ 10;
// }
// print("Sum of digits of above number is : ${sum}");
// }
/// Assignment 42 : Write a program to print the 10 values from an array
// void main()
// {
// var numbers = [];
// print("Enter the First Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Second Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Third Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Fourth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Fifth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Sixth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Seventh Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Eighth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Ninth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print("Enter the Tenth Number : ");
// numbers.add(int.parse(stdin.readLineSync()!));
// print(numbers);
// }
/// Assignment 43 : Write a program to print the sum of any 10 numbers from an array
// void main()
// {
// var sum = 0;
// var createObject = [20,70,10,64,32,21,55,40,29,36];
// for(var i = 0; i < createObject.length; i++)
// {
// sum = sum + createObject[i];
// }
// print(sum);
// }
/// Assignment 44 : Write a program to print the multiplication of any 10 numbers from an array
// void main()
// {
// var mul = 1;
// var objectcreate = [20,70,10,64,32,21,55,40,29,36];
// for(var i = 0; i < objectcreate.length; i++)
// {
// mul = mul * objectcreate[i];
// }
// print(mul);
// }
/// Assignment 45 : Write a program to print the even numbers from an array.
// void main()
// {
// var createObject = [20,70,10,64,57,32,21,55,40,29,41,59,36,54,32,74,47,21,84,0,100,27,43];
// for(var i = 0; i < createObject.length; i++)
// {
// if(createObject[i] %2 == 0)
// {
// print(createObject[i]);
// }
// }
// }
/// Assignment 46 : Write a program to print the sum of odd numbers from an array.
// void main()
// {
// var sum = 0;
// var createObject = [20,70,10,64,57,32,21,55,40,29,41,59,36,54,32,74,47,21,84,0,100,27,43];
// for(var i = 0; i < createObject.length; i++)
// {
// if(createObject[i] %2 == 1)
// {
// sum = sum + createObject[i];
// }
// }
// print(sum);
// }
/// Assignment 47 : Write a program to print the count of numbers which are divisible by 3 from an array
// void main()
// {
// var count = 0;
// var createObject = [20,70,10,64,57,32,21,55,40,29,41,59,36,54,32,74,47,21,84,0,100,27,43];
// for(var i = 0; i < createObject.length; i++)
// {
// if(createObject[i] %3 == 0)
// {
// count = count + 1;
// }
// }
// print(count);
// }
/// Assignment 50 : Write a program to sort given array in ascending order
// void main()
// {
// var createObject = [20,70,10,64,32,21,55,40,29,36,54,32,74,21,84,0,100,27,48,94,64];
// createObject.sort();
// print(createObject);
// }
/// Assignment 57 : Write a program to print simple message using Function
// class Message {
// void message() {
// print("This is the message which is printed using Function!");
// }
// }
// void main() {
// Message me = new Message();
// me.message();
// }
/// Assignment 58 : Write a program to print Addition of two numbers using function
// class AddWork {
// void addition(int a, int b) {
// var sum = a + b;
// print("Addition of Two Number is : ${sum}");
// }
// }
// void main() {
// AddWork object = new AddWork();
// print("Enter the First Number : ");
// var first = stdin.readLineSync();
// print("Enter the Second Number : ");
// var second = stdin.readLineSync();
// object.addition(int.parse(first!), int.parse(second!));
// }
/// Assignment 59 : Write a program to check the given number is Positive or
/// Negative using function
// class CheckNumber {
// void charNum(int a) {
// if(a > 0) {
// print("This is the positive number!");
// } else if(a < 0) {
// print("This is the Negative number!");
// } else {
// print("This is Zero number!");
// }
// }
// }
// void main() {
// CheckNumber number = new CheckNumber();
// print("Enter the Number : ");
// var num = stdin.readLineSync();
// number.charNum(int.parse(num!));
// }
/// Assignment 60 : Write a program to check the given number is Odd or Even using function
// class OddEven {
// void checkNum(int a) {
// if(a %2 == 0) {
// print("This number is Even!");
// } else if(a %2 == 1) {
// print("This number is Odd!");
// }
// }
// }
// void main() {
// OddEven num = new OddEven();
// print("Enter the Number : ");
// var check = stdin.readLineSync();
// num.checkNum(int.parse(check!));
// }
///Assignment 63:Write a program to print the maximum number out of three value using function
// class Maximum {
// void maximum(int a, int b, int c) {
// if(a > b && a > c) {
// print("First is the maximum OR biggest number from above three number!");
// } else if(b > a && b > c) {
// print("Second is the maximum OR biggest number from above three number!");
// } else {
// print("Third is the maximum OR biggest number from above three number!");
// }
// }
// }
// void main() {
// Maximum max = new Maximum();
// print("Enter the First Number : ");
// var first = stdin.readLineSync();
// print("Enter the Second Number : ");
// var second = stdin.readLineSync();
// print("Enter the Third Number : ");
// var third = stdin.readLineSync();
// max.maximum(int.parse(first!), int.parse(second!), int.parse(third!));
// }
/// Assignment 64 : Write a program to find the factorial of a given number using function
/// Pending
// class Factorial {
// var fact = 1, number;
// void factorial(int a) {
// for(int i = 1; i <= number; i++) {
// fact = fact * i;
// i--;
// }
// print("This is the Factorial of above Number : ${fact}");
// }
// }
// void main() {
// Factorial factObject = new Factorial();
// print("Enter the Number : ");
// var num = stdin.readLineSync();
// factObject.factorial(int.parse(num!));
// }
///Assignment 71:Write a program to create structure of an Employee details[id, name, salary]
// class Structure {
// void details(int a, String b, int c) {
// print("****************************************************");
// print("\t\t\t\t\tEmployee Details");
// print("****************************************************");
// print("Employee ID : ${a}");
// print("****************************");
// print("Employee name : ${b}");
// print("****************************");
// print("Employee salary : ${c}");
// print("****************************");
// }
// }
// void main() {
// Structure str = new Structure();
// print("Enter the Employee ID : ");
// var id = stdin.readLineSync();
// print("Enter the Employee name : ");
// var name = stdin.readLineSync();
// print("Enter the Employee salary : ");
// var salary = stdin.readLineSync();
// str.details(int.parse(id!), name.toString(), int.parse(salary!));
// }
/// Assignment 73 : Write a program to sorting an item from array of structure
// void main()
// {
// var objectOflist = [20,70,10,64,32,21,55,40,29,36,54,32,74,21,84,0,100,27,48,94,64];
// objectOflist.sort();
// print(objectOflist); //FIRST WAY TO PRINT SORTED LIST ELEMENTS
// print("\n");
// for(var a in objectOflist) //SECOND WAY TO PRINT SORTED LIST ELEMENTS
// {
// print(a);
// }
// }
/// Assignment 77 : Write a program to write a string into a file
// void main()
// {
// File assignObject = new File("assignment.txt");
// assignObject.writeAsStringSync("Material Design is a comprehensive guide for visual, motion, and"
// " interaction design across platforms and devices. To use Material Design in your Android apps,"
// " follow the guidelines defined in the Material Design specification."
// " If your app uses Jetpack Compose, you can use the Compose Material 3 library."
// " If your app uses views, you can use the Android Material Components library.");
// print("assignment.txt File is Created!!");
// }
/// Assignment 78 : Write a program to Read a string from a file
// void main()
// {
// File readObject = File("assignment.txt");
// String readContents = readObject.readAsStringSync();
// print(readContents);
// }
///WRITING A (.csv) FILE
// void main()
// {
// File writeObject = new File("assigncreate.csv");
// writeObject.writeAsStringSync("Whenever possible, use predefined Material Icons."
// " For example, for the navigation 'menu' button for your navigation drawer,"
// " use the standard 'hamburger' icon. See Material Design Icons for a list of available icons."
// " You can also import SVG icons from the Material Icon library with Android Studio's"
// " Vector Asset Studio.");
// print("assigncreate.csv File is Created!!");
// }
/// READ A (.csv) FILE
// void main()
// {
// File readObject = File("assigncreate.csv");
// String ContentObject = readObject.readAsStringSync();
// List<String> thingsread = ContentObject.split("\n");
// print("*********************************************");
// for(var a in thingsread)
// {
// print(a);
// }
// }
/// WRITING A (.pdf) FILE
// void main()
// {
// File demoObject = new File("mydemoFile.pdf");
// demoObject.writeAsStringSync("Animation APIs let you create custom animations for touch feedback"
// " in UI controls, changes in view state, and activity transitions.");
// print("mydemoFile.pdf File is Created!!!");
// }
/// READING A (.pdf) FILE
// void main()
// {
// File readObject = File("mydemoFile.pdf");
// String contents = readObject.readAsStringSync();
// print(contents);
// }
/// WRITING A (.doc) FILE
// void main()
// {
// File Objectcreate = new File("mydemoFile1.doc");
// Objectcreate.writeAsStringSync("Vector drawables are scalable without losing definition and"
// " are perfect for single-color in-app icons. Learn more about vector drawables."
// "Drawable tinting lets you define bitmaps as an alpha mask and tint them with a color at runtime."
// " See how to add tint to drawables. Color extraction lets you automatically extract prominent"
// " colors from a bitmap image. See how to select colors with the Palette API.");
// print("mydemoFile1.doc File is Created!!!");
// }
/// READING A (.doc) FILE
// void main()
// {
// File readObject = File("mydemoFile1.doc");
// String Objectcontent = readObject.readAsStringSync();
// print(Objectcontent);
// }
/// Assignment 2.8 : Write a program to print days using switch case [Hint: if user enter 1
/// then Monday should be printed]
// void main() {
// print("Enter the Number between 1 to 7 : ");
// var day = int.parse(stdin.readLineSync()!);
// switch(day) {
// case 1 : {
// print("Monday");
// } break;
// case 2 : {
// print("Tuesday");
// } break;
// case 3 : {
// print("Wednesday");
// } break;
// case 4 : {
// print("Thursday");
// } break;
// case 5 : {
// print("Friday");
// } break;
// case 6 : {
// print("Saturday");
// } break;
// case 7 : {
// print("Sunday");
// } break;
// default : {
// print("Oops, this is the Wrong number!");
// }
// }
// }
/// Assignment 2.26 : Write program to print id, name and salary of employee using
/// multiple objects of single class
// class Multiple {
// void empid() {
// print("1");
// }
// void empname() {
// print("Hitesh Kachhela");
// }
// void empsalary() {
// print("50,000");
// }
// }
// void main() {
// Multiple id = new Multiple();
// Multiple name = new Multiple();
// Multiple salary = new Multiple();
// id.empid();
// name.empname();
// salary.empsalary();
// }
/// Assignment 2.28 : Write a program to create constructor to print your name
// class Name {
// Name() {
// print("This is the Constructor Calling When the object is created!");
// }
// }
// void main() {
// Name name = new Name();
// }
/// Assingment 2.29 : Write a program to create parameterized constructor
// class Param {
// Param(int a, int b) {
// var c = a + b;
// print("This is the Addition : ${c}");
// }
// }
// void main() {
// print("Enter the Number 1 : ");
// var no1 = stdin.readLineSync();
// print("Enter the Number 2 : ");
// var no2 = stdin.readLineSync();
// Param pa = new Param(int.parse(no1!), int.parse(no2!));
// }
/// Assignment 2.32 : Write a program to create single inheritance
// class A {
// A() {
// print("This is Constructor calling from class A");
// }
// void addition(int a1, int b1) {
// var c = a1 + b1;
// print("This is the Addition : ${c}");
// }
// void subtraction(int c1, int d1) {
// var d = c1 - d1;
// print("This is the Subtraction : ${d}");
// }
// }
// class B extends A {
// B() {
// print("This is Constructor calling from class B");
// }
// void multiplication(int e1, int f1) {
// var e = e1 * f1;
// print("This is the Multiplication : ${e}");
// }
// void division(int g1, int h1) {
// var f = g1 / h1;
// print("This is the Division : ${f}");
// }
// }
// void main() {
// B object = new B();
// print("Please Enter the value of a : ");
// var a = stdin.readLineSync();
// print("Please Enter the value of b : ");
// var b = stdin.readLineSync();
// object.addition(int.parse(a!), int.parse(b!));
// object.subtraction(int.parse(a), int.parse(b));
// object.multiplication(int.parse(a), int.parse(b));
// object.division(int.parse(a), int.parse(b));
// }
/// Assignment 2.33 : Write a program to create multi-level inheritance
// class A {
// void addition(double a, double b) {
// var ans1 = a + b;
// print("This is the Addition : ${ans1}");
// }
// void subtraction(double c, double d) {
// var ans2 = c - d;
// print("This is the subtraction : ${ans2}");
// }
// }
// class B extends A {
// void multiplication(double x, double y) {
// var ans3 = x * y;
// print("This is the multiplication : ${ans3}");
// }
// }
// class C extends B {
// void division(double p, double q) {
// var ans4 = p / q;
// print("This is the division : ${ans4}");
// }
// }
// void main() {
// C object = new C();
// print("Enter the value of a : ");
// var a = double.parse(stdin.readLineSync()!);
// print("Enter the value of b : ");
// var b = double.parse(stdin.readLineSync()!);
// object.addition(a, b);
// object.subtraction(a, b);
// object.multiplication(a, b);
// object.division(a, b);
// }
/// Assignment 2.35 : Write a program to create multiple inheritance
/// NOTE : Unfortunately, Dart doesn't support multiple inheritance,
/// which means a class cannot extend more than one class.
// class A {}
// class B {}
// class C extends B,A {}
/// Assignment 2.37 : Write a program for the Runtime polymorphism
/// NOTE : Compile time polymorphism is not supported in dart(Flutter)
// class A {
// // A(String s) {
// // print("This is the class A");
// // }
// void addition(int no5, int no6) {
// var sum2 = no5 + no6;
// print("The Addition in class A is : ${sum2}");
// }
// }
// class B extends A {
// // B(String s) {
// // print("This is the class B");
// // }
// void addition(int no3, int no4) {
// var sum1 = no3 + no4;
// print("The Addition in class B is : ${sum1}");
// }
// }
// class C extends B {
// // C(String s) {
// // print("This is the class C");
// // }
// void addition(int no1, int no2) {
// var sum = no1 + no2;
// print("The Addition in class C is : ${sum}");
// }
// }
// void main() {
// C objectOfc = new C(/*"Below is class C calculation: "*/);
// B objectOfb = new B(/*"Below is class B calculation: "*/);
// A objectOfa = new A(/*"Below is class A calculation: "*/);
// print("Enter the value of A : ");
// var a = int.parse(stdin.readLineSync()!);
// print("Enter the value of B : ");
// var b = int.parse(stdin.readLineSync()!);
// objectOfc.addition(a, b);
// objectOfb.addition(a, b);
// objectOfa.addition(a, b);
// }
/// Assignment 2.39 : Write a program to create the virtual function show() in parent class and
/// normal function show() in child class. And call that functions
// class ParentClass {
// void show() {
// print("This is the Parent Class Method called by parent object!");
// }
// }
// class ChildClass extends ParentClass {
// void show() {
// print("This is the Child Class Method called by child object!");
// }
// }
// void main() {
// ParentClass parentObject = new ParentClass();
// ChildClass childObject = new ChildClass();
// parentObject.show();
// childObject.show();
// }
/// Assignment 2.44 : Make a static function and print hello through multiple objects of the class
// class Multiple {
// static message() {
// print("Hello World! How are you ?");
// }
// }
// void main() {
// Multiple mul = new Multiple();
// Multiple.message();
// }
Comments
Post a Comment