Posts

Vector in R programming.

Image
Vectors in R The term  vector  might sound intimidating. In  R  programming, a vector is the most-used data object. Like its counterpart in C++, it is a dynamic array of elements, each of the same data type. Another way to think of a vector is that it is a list of values, such as ratings, names, scores, prices, etc. A vector’s type can be checked with the  typeof()   function . Another important property of a vector is its length. This is the number of elements in the vector and can be checked with the function  length() . How to Create Vector in R? Vectors are generally created using the  c()  function. Since, a vector must have elements of the same type, this function will try and coerce elements to the same type, if they are different. Coercion is from lower to higher types from logical to integer to double to character. > x <- c(1, 5, 4, 9, 0) > typeof(x) [1] "double" > length(x) [1] 5 > x ...

OS Assignments

NM CA2 Ans

Java Programs and Outputs

Image
Program 1: display simple “Hello JAVA” Message. Input: class Hsimple { public static void main(String args[]) { System.out.println("Hello JAVA"); } } Output: Program 2: perform basic arithmetic Operation in java. Input: class Basicmath { public static void main(String args[]) { System.out.println("\t\tArithmatic Operator\n"); System.out.println("Integer Arithmatic"); int a = 1+1; int b = a*3; int c = b/4; int d = c-a; int e = -d; System.out.println("a = " +a); System.out.println("b = " +b); System.out.println("c = " +c); System.out.println("d = " +d); System.out.println("e = " +e); } } Output:                          Program 3: Implementation of Class, Object & Methods in java. Input: class Box { double width; double height; double depth; } class BoxDemo{ pub...