banner

Wednesday, December 7, 2016

LAB EXAM ON 13-12-16 (TUESDAY)

Schedule            9:30 AM - 12:00 PM  (Roll No : 1-28 ) 1:30 PM - 4:00 PM (Roll No : 29-57 ) Program  Create a database app... thumbnail 1 summary

  • Schedule           
        • 9:30 AM - 12:00 PM  (Roll No : 1-28)
        • 1:30 PM - 4:00 PM (Roll No : 29-57)
  • Program 
        • Create a database application performing the basic CRUD operations.
        • The question will be similar to this tutorial posted earlier in this blog 
  • Lab Record
        • Submit your Lab Record  before you appear for the exam
        • Include the database application as the last program in the list
        • Front Page and TOC of the Record can be downloaded from the following link.

https://docs.google.com/document/d/1IUmaBnPOMG6TuwUSImpWl_JOhBWjUO9fT78k6d_tva0/edit?usp=sharing

Thursday, November 10, 2016

MySQL and NetBeans

Visit this links and follow the demonstration Creating Connecting and testing the connection - PHPMyAdmin https://www.youtube.com/wat... thumbnail 1 summary

Visit this links and follow the demonstration

Creating Connecting and testing the connection - PHPMyAdmin
https://www.youtube.com/watch?v=BCqW5XwtJxY

Create a database application performing the basic CRUD operations.

http://1bestcsharp.blogspot.in/2016/01/java-and-mysql-insert-update-delete-display.html

Thursday, November 3, 2016

PROTOTYPE EVALUATION CRITERIA

Each member of the group is expected to maintain a record of the tasks he/she has performed in the development of the prototype. Pleas... thumbnail 1 summary

Each member of the group is expected to maintain a record of the tasks he/she has performed in the development of the prototype. Please fill this form to record your contribution in the development process, before November 14. A printed report in the same format shall be submitted on the day of evaluation (to be  incorporated in your lab record later).

In today's session you are expected to complete the User Interface Design (UI) of the product after due consultation with all team members. Please hand over a fair copy of the completed design to us before 3:15 PM today.

ASSESSMENT RESULT (ASSIGNMENT + EXERCISES)

Click on this   link for knowing your marks of assignment and the exercises. thumbnail 1 summary

Click on this  link for knowing your marks of assignment and the exercises.

Monday, October 31, 2016

ASSESSMENT EXERCISES - FIRST BATCH

First question carries 5 marks and second question carries 10 marks . Create a class called Invoice that a hardware store might use t... thumbnail 1 summary


First question carries 5 marks and second question carries 10 marks.
  1. Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables‐a part number(type String),a part description(type String),a quantity of the item being purchased (type int) and a price per item (double). 
    1. Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. 
    2. In addition, provide a method named getInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. 
    3. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. 
    4. Write a test application named InvoiceTest that demonstrates class Invoice’s capabilities.
  2. Write a Java applet program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the + – * % operations. Add a text field to display the result. The output should look as the following screenshot. 



import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="Cal" width=300 height=300></applet>*/

Thursday, October 27, 2016

LAB ASSIGNMENT

Today we will build a simple java GUI application as an assignment. For this application you will be making use of the GUI builder features... thumbnail 1 summary
Today we will build a simple java GUI application as an assignment. For this application you will be making use of the GUI builder features of the NetBeans IDE.This will be considered as an assignment for PMC 1622 course. On successful completion of this task you will be awarded 10 marks. Marks will be given based on the time taken to complete this task. Once you finish the task please demonstrate it at the earliest opportunity(In this lab session itself).



To get the Instructions for completing this assignment click on this link.

REVISED MARKS DISTRIBUTION

Following is the revised assessment of PMC 1622 based on our discussions      Lab Exercises     : 15 (5 + 10)      Lab Assignment : 10... thumbnail 1 summary
Following is the revised assessment of PMC 1622 based on our discussions

  •      Lab Exercises     : 15 (5 + 10)
  •      Lab Assignment : 10 
  •      Lab Record         : 10
  •      Attendance          : 5
  •      Project Work :      60
    • Individual Contribution : 30
    • Overall                              : 30
TOTAL : 100 MARKS

Friday, October 21, 2016

LIST OF PROGRAMMING EXERCISES

Ask the user to enter two integers and print their sum, product, difference and quotient  Read a string from the keyboard, and output t... thumbnail 1 summary
  1. Ask the user to enter two integers and print their sum, product, difference and quotient 
  2. Read a string from the keyboard, and output the string twice in a row, first all uppercase and next all lowercase.
  3. Check if a string is a palindrome or not
  4. Find the missing numbers in an  array
  5. Return the average of the marks in an array
  6. Create a SavingsAccount class and test its methods.
  7. Create a Employee Class and compute the salary.
  8. Inherit the car class and compute the selling price for various models
  9. Create a simple calculator with Applet
  10. Convert the temperature from one scale to another using Applet.

Thursday, October 20, 2016

PE10 : Temperature Conversion Using APPLET

a)Write a temperature conversion applet that converts from Fahrenheit to Celsius . The Fahrenheit temperature should be entered from the... thumbnail 1 summary
a)Write a temperature conversion applet that converts from Fahrenheit to Celsius. The Fahrenheit temperature should be entered from the keyboard (via a TextField). A Label should be used to display the converted temperature. Use the following formula for the conversion:
Celcius = ((5/9)*(Ferenheit‐32)).

more challenge ..

b.) Enhance the temperature conversion applet by adding the Kelvin temperature scale. The applet should also allow the user to make conversions between any two scales. Use the following formula for the conversion between Kelvin and Celsius : 
Kelvin = Celcius + 273.15




AN IDEAL OUTPUT SHOULD LOOK LIKE THIS


Note : You may use Java SWING objects as well to accomplish the task. 


FIRST CONTINUOUS ASSESSMENT ON OCT 31, 2016

Dear Students,     First assessment of  your Java lab  performance for  the calculation of  internal marks will be held on October 31,... thumbnail 1 summary
Dear Students,

    First assessment of  your Java lab  performance for  the calculation of  internal marks will be held on October 31, 2016. As per the published CARS and CADL criteria we will be conducting first activity in the CARS (Programming Exercises)  based on the exercises you have done till now in the lab sessions (including today's). Questions will be of similar nature (Will not be the exact ones).

Also prepare for a Viva-Voce(CADL) of the topics covered till October 28, 2016 on the same day.

For marks distribution refer the previously posted table of CARS and CADL



Monday, October 17, 2016

PE9 : SIMPLE CALCULATOR USING APPLET

Write a Java program that works as a simple calculator . Use a grid layout to arrange buttons for the digits and for the + – * % operation... thumbnail 1 summary
Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the + – * % operations. Add a text field to display the result.



import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="Cal" width=300 height=300></applet>*/

Thursday, October 6, 2016

Programming with NetBeans IDE

Session Objectives Get familiar with programming in NetBeans IDE. Migrate all your java programs done till now to NetBeans. Creat... thumbnail 1 summary

Session Objectives
  • Get familiar with programming in NetBeans IDE.
  • Migrate all your java programs done till now to NetBeans.
    • Create individual projects for each programs and name them as PE1, PE2....PE8
    • For programs with multiple classes create different java files corresponding to each class in the same project 
    • For the time being keep the package name as default 
    • Individually compile each file 
    • Run the file containing the 'main' class to get the required output. 
  • Learn to debug the program using the IDE debugger.

For  learning more in detail about the NetBeans IDE, download the following eBook.

https://drive.google.com/file/d/0B5_k_BrjMqPHSHNuZS1oYmN0cnc/view?usp=sharing

Thursday, September 29, 2016

PE8: Inheriting the Car Class

a) Create a super class called Car . The Car class has the following fields and methods. int speed; double regularPrice; String c... thumbnail 1 summary

a) Create a super class called Car. The Car class has the following fields and methods.

  • int speed;
  • double regularPrice;
  • String color;
  • double getSalePrice();

b) Create a subclass of Car class and name it as Ford. The Ford class has the following fields and methods

  • int year;
  • int manufacturerDiscount;
  • double getSalePrice(); //From the salepricecomputed from Car class, subtract the manufacturerDiscount.

c) Create a subclass of Car class and name it as Sedan. The Sedan class has the following fields and methods.

  • int length;
  • double getSalePrice(); //If length >20feet, 5% discount,Otherwise,10% discount.

d) Create MyOwnAutoShop class which contains the main() method. Perform the following within the main() method.
  • Create an instance of Sedan class and initialize all the fields with appropriate values. 
  • Create two instances of the Ford class and initialize all the fields with appropriate values. 
  • Create an instance of a Car class and initialize all the fields with appropriate values.
  • Display the sale prices of all instance.
// Note : Use this and Super() wherever applicable

Monday, September 26, 2016

PE7 : Computing the Employee Salary

Create a class called Employee that includes three pieces of information as instance variables— a first name (typeString), a last n... thumbnail 1 summary

Create a class called Employee that includes three pieces of information as instance variables—
a first name (typeString), a last name (typeString) and a monthly salary (double). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, set it to 0.0. 
Write a test application named EmployeeTest that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10% raise and display each Employee’s yearly salary again.

Thursday, September 22, 2016

PE6: Savings Account Class Operations

/* Create a class SavingsAccount . Use a static variable annualInterestRate to store the annual interest rate for all account holder... thumbnail 1 summary

/* Create a class SavingsAccount. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance indicating the amount the saver currently has ondeposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12. this interest should be added to savingsBalance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value.

Write a program to test the class SavingsAccount. Instantiate two SavingsAccount objects, saver1 and saver2, with balances of Rs2000.00 and Rs3000.00, respectively. Set annualInterestRate to 4%, then calculate the monthly interest and print the new balances for both savers. Set the annualInterestRate to 5%, calculate the next month’s interest and print the new balances for both savers. */

Thursday, September 8, 2016

PE5: (Array) Calculation of average marks

/* Write a Java program that allows the user to enter up to 10 integer marks into an array. Your main method should call an Average method... thumbnail 1 summary
/* Write a Java program that allows the user to enter up to 10 integer marks into an array. Your main method should call an Average method that returns the average of the marks in the array. */

OUT PUT :


Monday, September 5, 2016

PROGRAM DEMO : SORTING AN ARRAY

import java.util.Arrays ; public class ArrayDemo { public static void main (String[] args) { // initializing unsorted int ... thumbnail 1 summary

import java.util.Arrays;

public class ArrayDemo {

   public static void main(String[] args) {

   // initializing unsorted int array
   int iArr[] = {2, 1, 9, 6, 4};

   // let us print all the elements available in list
   for (int number : iArr) {
   System.out.println("Number = " + number);
   }

   // sorting array
   Arrays.sort(iArr);

   // let us print all the elements available in list
   System.out.println("The sorted int array is:");
   for (int number : iArr) {
   System.out.println("Number = " + number);
   }
   }
}


PE4 : (ARRAY) Find missing numbers

Write a program to find missing numbers in an  array /* To find missing numbers in an array first we need to make sure that arra... thumbnail 1 summary


Write a program to find missing numbers in an  array

/*




  • To find missing numbers in an array first we need to make sure that array is sorted.
  • After sorting we need to check that array each element with next element then we can find the difference.
  • if Array is not sorted :To sort array use Arrays.sort(array);
  • If difference is 1 then no need to do any thing because numbers are in order.
  • If difference is not equal to 1 then we need to print all those numbers or pick those numbers and place it in one array.
  • this would be the logic to find missing numbers in an array
  • Here there may be a chance of array not starting with 1. then we need to check first itself whether array starts with 1 or not if not we need to print 1 to starting element of array.
  • for example int a[]={4,5,6,8}; then we need to print 1 2 3  7.
  • PE 3 : Program to check if a string is a palindrome or not.

    Write a Java program to check if a string is a palindrome or not .  /* Remember a string is a palindrome, if it remains unchanged when ... thumbnail 1 summary

    Write a Java program to check if a string is a palindrome or not
    /* Remember a string is a palindrome, if it remains unchanged when reversed, for example "dad" is a palindrome as reverse of "dad" is "dad" whereas "program" is not a palindrome. Some other palindrome strings are "mom", "madam", "abcba". */

    Tuesday, August 30, 2016

    PROGRAM DEMO : ARRAYS

      public class ArrayDemo { public static void main ( String [] args) { int n = Integer . parseInt(args[ 0 ]); ... thumbnail 1 summary
     
    public class ArrayDemo {
        public static void main(String[] args) {
            int n = Integer.parseInt(args[0]);
    
            // initialize to random values between 0 and 1
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = Math.random();
            }
    
            // print array values, one per line
            System.out.println("a[]");
            System.out.println("-------------------");
            for (int i = 0; i < n; i++) {
                System.out.println(a[i]);
            }
            System.out.println();
            System.out.println("a = " + a);
            System.out.println();
    
            // find the maximum
            double max = Double.NEGATIVE_INFINITY;
            for (int i = 0; i < n; i++) {
                if (a[i] > max) max = a[i];
            }
            System.out.println("max = " + max);
    
    
            // average
            double sum = 0.0;
            for (int i = 0; i < n; i++) {
                sum += a[i];
            }
            System.out.println("average = " + sum / n);
    
            // copy to another array
            double[] b = new double[n];
            for (int i = 0; i < n; i++) {
                b[i] = a[i];
            }
    
            // reverse the order
            for (int i = 0; i < n/2; i++) {
                double temp = b[i];
                b[i] = b[n-i-1];
                b[n-i-1] = temp;
            }
    
            // print array values, one per line
            System.out.println();
            System.out.println("b[]");
            System.out.println("-------------------");
            for (int i = 0; i < n; i++) {
                System.out.println(b[i]);
            }
            System.out.println();
    
    
            // dot product of a[] and b[]
            double dotProduct = 0.0;
            for (int i = 0; i < n; i++) {
                dotProduct += a[i] * b[i];
            }
            System.out.println("dot product of a[] and b[] = " + dotProduct);
    
        }
    
    }
    
    

    Monday, August 29, 2016

    PE 2 : String Manipulation

    /*  *Write a Java program that reads a string from the keyboard, and outputs the string twice in a row, first all uppercase and next al... thumbnail 1 summary

    /*
     *Write a Java program that reads a string from the keyboard, and outputs the string twice in a row, first all uppercase and next all lowercase.
    If, for instance, the string “Hello" is given, the output will be “HELLOhello"
     */

    TIP : Use the Scanner and String Methods

    Sunday, August 28, 2016

    PROGRAM DEMO :STRING METHODS

    Program to illustrate all string methods : // Java code to illustrate different constructors and methods // String class. import... thumbnail 1 summary
    
    
    Program to illustrate all string  methods:
    // Java code to illustrate different constructors and methods 
    // String class.
     
    import java.io.*;
    import java.util.*;
    class Test {
            public static void main (String[] args){
            String s= "MarianKuttikkanam";
            // or String s= new String ("MarianKuttikkanam");
     
            // Returns the number of characters in the String.
            System.out.println("String length = " + s.length());
     
            // Returns the character at ith index.
            System.out.println("Character at 3rd position = "
                               + s.charAt(3));
     
            // Return the substring from the ith  index character
            // to end of string
            System.out.println("Substring " + s.substring(3));
     
            // Returns the substring from i to j-1 index.
            System.out.println("Substring  = " + s.substring(2,5));
     
            // Concatenates string2 to the end of string1.
            String s1 = "Marian";
            String s2 = "Kuttikkanam";
            System.out.println("Concatenated string  = " +
                                s1.concat(s2));
     
            // Returns the index within the string
            // of the first occurrence of the specified string.
            String s4 = "Information Formation Transformation";
            System.out.println("Index of Transformation " + 
                                  s4.indexOf("Transformation")); 
            // Returns the index within the string of the
            // first occurrence of the specified string,
            // starting at the specified index.
            System.out.println("Index of a  = " + 
                               s4.indexOf('a',3));
     
            // Checking equality of Strings
            Boolean out = "Marian".equals("marian");
            System.out.println("Checking Equality  " + out);
            out = "Marian".equals("Marian");
            System.out.println("Checking Equality  " + out);
     
            out = "Marian".equalsIgnoreCase("mArIan ");
            System.out.println("Checking Equality" + out);
     
            int out1 = s1.compareTo(s2);
            System.out.println("If s1 = s2" + out);
     
            // Converting cases
            String word1 = "MARIAN";
            System.out.println("Changing to lower Case " +
                                word1.toLowerCase());
     
            // Converting cases
            String word2 = "marian";
            System.out.println("Changing to UPPER Case " + 
                                word1.toUpperCase());
     
            
        } 
    }
    

    Thursday, August 25, 2016

    PROGRAMMING EXERCISE 1

    Write an application that asks the user to enter two integers, obtains them from the user and prints their sum, product, difference a... thumbnail 1 summary


    Write an application that asks the user to enter two integers, obtains them from the user and prints their sum, product, difference and quotient (division). (Use the Scanner Class )

    Wednesday, August 24, 2016

    PROGRAM DEMO : SCANNER

    // Java program to read data of various types using Scanner class. import java.util.Scanner ; public class ScannerDemo1 { publ... thumbnail 1 summary

    // Java program to read data of various types using Scanner class.
    import java.util.Scanner;
    public class ScannerDemo1
    {
        public static void main(String[] args)
        {
            // Declare the object and initialize with
            // predefined standard input object
            Scanner sc = new Scanner(System.in);
     
            // String input
            String name = sc.nextLine();
     
            // Character input
            char gender = sc.next().charAt(0);
     
            // Numerical data input
            // byte, short and float can be read
            // using similar-named functions.
            int age = sc.nextInt();
            long mobileNo = sc.nextLong();
            double cgpa = sc.nextDouble();
     
            // Print the values to check if input was correctly obtained.
            System.out.println("Name: "+name);
            System.out.println("Gender: "+gender);
            System.out.println("Age: "+age);
            System.out.println("Mobile Number: "+mobileNo);
            System.out.println("CGPA: "+cgpa);
        }
    }
    
    

    SURVEY RESPONSES

    This survey was conducted to know the background of the students who are the participants of this course. The questions ranged from a ... thumbnail 1 summary

    This survey was conducted to know the background of the students who are the participants of this course. The questions ranged from a self assessment of their Java Programming skills to the details of their previous software project.

    Some responses which could be graphically projected are shown below.





    Sunday, August 21, 2016

    WELCOME

    This blog will act as the one stop information center of your Java Programming Lab. First let me find out some information about your b... thumbnail 1 summary

    This blog will act as the one stop information center of your Java Programming Lab.
    First let me find out some information about your background.Please fill this form