3 A – Write a Java program to read two integers a and b. Compute a/b and print, when b is not zero. Raise an exception when b is equal to zero.import java.util.Scanner;public class lab3a { lab3a() { int a,b; float c; Scanner sc=new Scanner(System.in); try { System.out.println(“Enter the value of a”); a=sc.nextInt(); System.out.println(“Enter the value ..

Read more

10 – WRITE A PHP PROGRAM TO SORT THE STUDENT RECORDS WHICH ARE STORED IN THE DATABASE USING SELECTION SORT. SOLUTION  1  Requires XAMPP control panel for Solution 1 prog10.php <?php $servername = “localhost”; $username = “root”; $password = “”; $dbname = “weblab”; $conn = mysqli_connect($servername, $username, $password, $dbname); if (!$conn) { die(“Connection failed: ” . mysqli_connect_error()); } ..

Read more

7. Implement using functions to check whether the given number is prime and display appropriate messages. (No built-in math function) ALGORITHM: Step 1: Start  Step 2: [Read the value of N(positive integers)]     Read N  Step 3: [to check whether N is prime or not] For i=2 to m/2  If m%i=0 then go to ..

Read more

12. Develop a program to find the square root of a given number N and execute for all possible inputs with appropriate messages. Note: Don’t use library function sqrt(n).Algorithm: Step 1: start Step 2: read number Step 3: calculate number to the power of 0.5(sq=pow(n,0.5)) Step 4: print sq Step 5: stop FLOWCHART: PROGRAM:#include<stdio.h>#include<math.h> int ..

Read more

12. Write a program for congestion control using leaky bucket algorithm.Leaky.java – PROGRAMimport java.util.Scanner;public class Leaky { public static void main(String[] args)  { Scanner sc = new Scanner(System.in); int bcktsize, iter, rate, line, total = 0; int[] pkt = new int[25]; System.out.print(“Enter the bucket size and output rate(both in MB):”); bcktsize = sc.nextInt(); rate = sc.nextInt(); System.out.println(“Enter ..

Read more

9. Design, Develop and Implement a Program in C for the following operations on Singly Circular Linked List (SCLL) with header nodes a. Represent and Evaluate a Polynomial P(x,y,z) = 6x2y2z-4yz5+3x3yz+2xy5z-2xyz3 b. Find the sum of two polynomials POLY1(x,y,z) and POLY2(x,y,z) and store the result in POLYSUM(x,y,z) Support the program with appropriate functions for each of the above ..

Read more

5 -DESIGN AN XML DOCUMENT TO STORE INFORMATION ABOUT A STUDENT IN AN ENGINEERING COLLEGE AFFILIATED TO VTU. THE INFORMATION MUST INCLUDE USN, NAME, AND NAME OF THE COLLEGE, BRANCH, YEAR OF JOINING, AND EMAIL ID. MAKE UP SAMPLE DATA FOR 3 STUDENTS. CREATE A CSS STYLE SHEET AND USE IT TO DISPLAY THE DOCUMENT. SOLUTION  ..

Read more

10 – a). Design, develop and implement a C/C++/Java program to simulate a numerical calculator.lab10a.c PROGRAM#include <stdio.h> int main(){ char operator; float num1, num2, result; printf(“Simulation of a Simple Calculatornn”); printf(“Enter two numbers n”); scanf(“%f %f”, &num1,&num2); fflush(stdin); printf(“nEnter the operator [+,-,*,/] n”); scanf(“%s”, &operator); switch(operator) { case ‘+’: result = num1 + num2; break; ..

Read more

3. Develop a program to compute the roots of a quadratic equation by accepting the coefficients. Print appropriate messages.Algorithm: Step1:[read the values of A,B and C]       Read A,B,C Step2:[check for the co-efficients]      If  A=0 and B=0 and C=0       Then roots are non-determinant Step 3:[compute the value of Disc]    ..

Read more