Posts

Showing posts from June, 2014

CS 4150 Midterm

LEARN FROM MY MISTAKES Dalibor Labudovic CS 4150 Midterm All answers to discussion questions need to be in complete sentences and grammatically correct! 80/100 Compare static type binding and dynamic type binding. Be sure to use the four criteria (readability, writability, reliability, and cost). Comparing static type binding and dynamic type binding is determining whether a type binding has the ability to be changed. Static type binding obviously cannot be changed, under the four criteria’s: readability is low, writability is high ( variables have to utilized in another way to extend size ) , reliability is high (because following as the type is being used in one way and then in a different when the size has to altered) and cost is high. My thoughts on cost being high are the limitation a static type binding would pose on scalability. Dynamic type binding can be changed and under the four criteria’s: readability is high (a variable is hard to follow) , w…

Double Transposition in Java

/* Dalibor Labudovic*/
/* not stable */

package doubletransporition;

import java.io.*;
import java.util.*;
class NewDoubleTransposition
{
    public static void main(String args[])
    {
        NewEncryptAndDecrypt ned=new NewEncryptAndDecrypt();
        ned.input();
    }
}
class NewEncryptAndDecrypt
{
    Scanner sc=new Scanner(System.in);
    void input()
    {
        int ch;
        do
        {
            System.out.println("\n\t\t*****ENTER*****");
            System.out.println("\t1.Encrypt");
            System.out.println("\t2.Decrypt");
            System.out.println("\t0.Exit");
            ch=sc.nextInt();
            switch(ch)   
            {
                case 1:
                {
                    encrypt();
                    break;
                }
                case 2:
                {
                    decrypt();
                    break;
                }
            }
        }while(ch!=0);
    }
    void encrypt()
    {


        //String ip,t;
   …

Vigenere Cipher in Java

/* Dalibor Labudovic */
/* Not 100% stable but work ok*/

package cs3550;
import java.util.Scanner;

public class vigenerecipher {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner input = new Scanner(System.in);


        System.out.println("Encyption...");
        System.out.println("Enter Pass Phrase: ");
        String phrase = input.nextLine();
        System.out.println("Enter plain Text: ");
        String plain = input.nextLine();
        System.out.print("Here is the encryption: ");
        String enc = encrypt(plain, phrase);
        System.out.println(enc);

        System.out.println("Decrpytion...");
        System.out.println("Decoding " + enc);
        System.out.println("Enter pass phrase: ");
        String dePhrase = input.nextLine();
        System.out.println("Decryption : " + decrypt(enc, dePhrase));
    }

    static String encrypt(String text, final S…

CS3401 Quiz 3