Friday, January 27, 2017

Leetcode python reverse digits of an integer( Has to be corrected though) assignments programming team

def revintegers(int num): #-321
 
    while num !=0 {
        if num > 0{
            mod = num % 10;  #-1
            num = num / 10; #
            revorder = revorder * 10 + mod;
            }
        elif num < 0 {
            num = -1 * num;
            mod = num % 10;
            num = num / 10;
            revorder = (revorder * 10 + mod) * -1;
            }
    return revorder;
        }
 
revintegers(321)

Tuesday, January 24, 2017

Java control flow

public class Conditionals {
public static void main(String[] args) {


if (1 < 4 && 0 > 5) {

System.out.println("You ordered a cup of hot, mint tea.");

} else if (21 <= 19 || 17 >= 28) {

System.out.println("You ordered freshly squeezed orange juice!");

} else if ( !(true == true) ) {

System.out.println("You ordered hot cocoa!");

} else {

System.out.println("You ordered a cup of Java!");

}

char answerChoice = 'C';

switch (answerChoice) {

case 'A': System.out.println("You answered: " + answerChoice + ". Please try again.");
break;

case 'B': System.out.println("You answered: " + answerChoice + ". Please try again.");
break;

case 'C': System.out.println("You answered: " + answerChoice + ". That is correct!");
break;

case 'D': System.out.println("You answered: " + answerChoice + ". Please try again.");
break;

default:
System.out.println("Please select a valid answer choice.");

}


}
}

JAVA (general) my first programming

String data type:

public class YourName {
public static void main(String[] args) {

System.out.println("Ashok");

}
}



Integer Data type:

public class DataTypes {
public static void main(String[] args) {

System.out.println(2);

}
}

Boolean data type:

public class DataTypesB {
public static void main(String[] args) {

System.out.println(true);

}
}

Make Bootbale USB

How to make Bootable USB from any windows CD or Copy an Existing Bootbale USB Without Downloading Software.

1. Open a cmd.exe command prompt as an an administrator. (Right click and run as administrator) 2. type in "diskpart" 3. type in "list disk" 4. type in "select disk _" where _ is the number corresponding to your usb disk 5. type in "clean" 6. type in "create partition primary" 7. type in select partition 1 8. type in "active" 9. type in "format fs=ntfs" 10. type in "assign" 11. type in exit to close the window 12. Change to the windows CD drive letter or existing windows bootable usb drive letter. "d:" 13. At the root of your drive letter, you need to change directories to the boot folder. "cd boot" 14. type in "bootsect.exe/nt60 f:" Where f: is the drive letter corresponding to the drive that you WANT to be putting the windows installation CD ON. 15. After everything has been done, just highlight all of the files/folders at the root of the CD or existing bootable usb, and copy them over to the new drive. It is now a bootable windows USB!