Posts

Showing posts from September, 2024

IOT

 LCD WITH ONE 7 SEGMENT AND 3 POTENTIOMETER AND 1 CMYK #include <LiquidCrystal.h> LiquidCrystal lcd1(1,2,3,4,12,13); void setup() ( lcd1.begin(16,2); pinMode (13, OUTPUT); pinMode (12, OUTPUT); pinMode (11, OUTPUT); pinMode (A0, INPUT); pinMode (A1, INPUT); pinMode (A2, INPUT); pinMode (A3, OUTPUT); pinMode (A4, OUTPUT); pinMode (A5, OUTPUT); pinMode (10, OUTPUT); pinMode (9, OUTPUT); pinMode (8, OUTPUT); pinMode (7, OUTPUT); } void loop() int x = map (analogRead(A0),0,1023,0,255); int y map (analogRead(A1), 0,1023,0,255); int z = map (analogRead (A2),0,1023,0,255); analogWrite(5,x); analogWrite(11,y); analogWrite(6,z); if (x = 255) lcd1.clear(); lcd1.write("Red"); delay(1000); digitalWrite(A3,1); digitalWrite(A4,1); digitalWrite(A5,1); digitalWrite(9,1); digitalWrite(8,1); digitalWrite(7,1); digitalWrite(10,0); delay(1000); digitalWrite(10,1); digitalWrite(A4,0); digitalWrite(A5,0); delay(1000); digitalWrite (A3,0); digitalWrite(A4,1); digitalWrite(A5,1);  digitalWrite...

AWP SQL

A) Create a web application bind data in a multiline textbox by querying in another textbox. protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn=new SqlConnection(); conn.ConnectionString="Data Source=COMP254;Initial Catalog=TYIT;Integrated Security=True"; //stringconnStr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString; //SqlCommand cmd = new SqlCommand("Select Id,Name,Password from Login", conn); SqlCommand cmd = new SqlCommand(TextBox1.Text, conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { TextBox2.Text += reader["Id"].ToString() + " " + reader["Name"].ToString() + " " + reader["Password"].ToString() + "\n"; } reader.Close(); conn.Close(); }  B) Create a web application to display records by using database. protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(); conn...

AWP_registration

 a. Aim : Create a simple web page with various server controls to demonstrate setting and use of their properties.  Code:  Page_Load Function: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication6 { public partial class AKN_Prac3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { for(int i=1;i<=31;i++) { DropDownList6.Items.Add(i.ToString()); } for (int i = 1; i <= 10; i++) { DropDownList4.Items.Add(i.ToString()); } for (int i = 2000; i <=2005; i++) { DropDownList3.Items.Add(i.ToString()); } } T.Y.B.Sc.IT ADVANCE WEB PROGRAMMING 25  Button_Click Function : protected void Button1_Click(object sender, EventArgs e) { String str = ""; str = "Your Name is : " + TextBox1.Text + "\n"; str = str + "Your Address is :" + TextBox2.Text + "\n"; if (RadioButton1.Checked) { str = str + RadioButton1....

AWP_2

 WORKING WITH Object Oriented C# AND ASP.NET a) Create simple application to demonstrate use of following concepts. i. Function Overloading  Aim: Write a program using function overloading to swap two integer numbers and swap two float numbers.  Code: using System; namespace practical2 { class Overloading { public void swap(ref int n, ref int m) { int t; t = n; n = m; m = t; } public void swap(ref float f1, ref float f2) { float f; f = f1; f1 = f2; f2 = f; } class program { static void Main(string[] args) { Overloading objOverloading = new Overloading(); int n = 54, m = 34; objOverloading.swap(ref n, ref m); Console.WriteLine("N=" + n + "\tM=" + m); float f1 = 19.5f, f2 = 69.4f; objOverloading.swap(ref f1, ref f2); Console.WriteLine("F1=" + f1 + "\tF2=" + f2); Console.ReadKey(); } } } }  Output: ii. Inheritance (All types) : a) Aim: Write a program to implement Single Level Inheritance.  Code: using System; namespace Inheritance { class fu...

AWP-1

 PRACTICAL NO.1 a) Aim : Enter 4 number and find the product of the same. ⮚ Code: using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int num1, num2, num3, num4, prod; Console.Write("Enter number 1:"); num1 = Int32.Parse(Console.ReadLine()); Console.Write("Enter number 2:"); num2 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter number 3:"); num3 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter number 4:"); num4 = Convert.ToInt32(Console.ReadLine()); prod = num1 * num2 * num3 * num4; Console.WriteLine(num1 + "*" + num2 + "*" + num3 + "*" + num4 + "=" + prod); Console.ReadKey(); }}} ⮚ Output: b) Aim: Create an application to demonstrate String operation ⮚ Code: using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //Concatenation Console.Write("Enter string 1:"); string words = Console.ReadLin...

AI

 # DFS print("****** DEPTH FIRST SEARCH *******") graph1 = { 'A': set(['B', 'C']), 'B': set(['A', 'D', 'E']), 'C': set(['A', 'F']), 'D': set(['B']), 'E': set(['B', 'F']), 'F': set(['C', 'E']) } def dfs(graph, node, visited): if node not in visited: visited.append(node) for n in graph[node]: dfs(graph,n, visited) return visited visited = dfs(graph1,'A', []) print(visited) #BFS graph = { '5' : ['3','7'], '3' : ['2', '4'], '7' : ['8'], '2' : [], '4' : ['8'], '8' : [] } visited = [] # List for visited nodes. queue = [] #Initialize a queue def bfs(visited, graph, node): #function for BFS visited.append(node) queue.append(node) while queue: ...