воскресенье, 11 декабря 2016 г.

1q1->0q1R
0q1->1q2R
0q2->0q2R
1q2->0q3R
0q3->1q4R
1q3->0q5R
Bq5->BSTOPR

100101 -----------010011


0q1->1q2R
0q2->0q2R
1q2->1q3R
0q3->0q4R
0q4->1q5R
1q5->0q5R
Bq5->BSTOPR

0010011 -------------1010100

1q1->0q2R
0q2->1q3R
1q3->0q4R
1q4->1q5R
0q4->1q5R
0q5->1q5R
1q5->0q5R
Bq5->BSTOPR

101101 -------------010110

воскресенье, 4 декабря 2016 г.

1.   SELECT ContactName,City
FROM customers;

2. SELECT DISTINCT City
FROM customers;

3. SELECT * FROM customers
WHERE country='Mexico';


4. SELECT * FROM `customers` 
WHERE country<>'Canada'


5. SELECT `ID`, `ContactName`, `Address`, `City`, `PostalCode`, `Country` FROM `customers` WHERE ID<=10
6.
7. SELECT * FROM customers
ORDER BY city;
8.
9.
10.





























четверг, 1 декабря 2016 г.

import java.util.Scanner;
class Main {
  public static void main(String[] args) {
     Scanner input = new Scanner(System.in);
    int array[] = new int[5];
    System.out.println("Insert array elements:");
    for (int i = 0; i < 5; i++) {
        array[i] = input.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int i = 0; i < 5; i++) {
        System.out.print (" " + array[i]);}
        Scanner nput = new Scanner(System.in);
    int Narray[] = new int[10];
    System.out.println();
    System.out.println("Insert array elements:");
    for (int k = 0; k < 10; k++) {
        Narray[k] = nput.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int k = 0; k < 10; k++) {
    System.out.print (" " + Narray[k]); }
    int xa;
    xa =0;
for (int l=0; l<10; l++) {
if (array[l]==Narray[l]){xa = xa + 1;}
if (xa = 5){System.out.print("yes");}else{System.out.print("no");}
  }
  }
}

import java.util.Scanner;
class Main {
  public static void main(String[] args) {
     Scanner input = new Scanner(System.in);
    int array[] = new int[5];
    System.out.println("Insert array elements:");
    for (int i = 0; i < 5; i++) {
        array[i] = input.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int i = 0; i < 5; i++) {
        System.out.print (" " + array[i]);}
        Scanner nput = new Scanner(System.in);
    int Narray[] = new int[10];
    System.out.println();
    System.out.println("Insert array elements:");
    for (int k = 0; k < 10; k++) {
        Narray[k] = nput.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int k = 0; k < 10; k++) {
    System.out.print (" " + Narray[k]); }
    int x=0;
for (int i=0; i<5; i++) {
if (array[i]<>Narray[k]){
x++}};
if {x=5}{System.out.print("yes");}else{System.out.print("no");}
  }
}
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
     Scanner input = new Scanner(System.in);
    int array[] = new int[5];
    System.out.println("Insert array elements:");
    for (int i = 0; i < 5; i++) {
        array[i] = input.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int i = 0; i < 5; i++) {
        System.out.print (" " + array[i]);}
        Scanner nput = new Scanner(System.in);
    int Narray[] = new int[10];
    System.out.println();
    System.out.println("Insert array elements:");
    for (int k = 0; k < 10; k++) {
        Narray[k] = nput.nextInt();
    }
    System.out.print ("Inserted array elements:");
    for (int k = 0; k < 10; k++) {
    System.out.print (" " + Narray[k]); }
    int l;
    while(l=5){if (array[i]==Narray[k]){l=l+1;}else{l=l;};}
    if (l=5){System.out.print ("yes");}else{System.out.print ("no");}
  }
}

среда, 23 ноября 2016 г.

воскресенье, 6 ноября 2016 г.

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication5;
import java.util.Scanner;
/**
 *
 * @author student
 */
public class car {
    public int evolume;
    public float maxspeed;
    public float horsepower;
    public char model;
    public char trademark;
    public char colour;
    public float speed;
    public int getmaxspeed(){
        float maxspeed=(1.5*evolume)/33;
        return maxspeed;      
    }  
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        car maxspeed=new car();
        car.colour=sc.nextLine();
        car.trademark=sc.nextLine();
        car.evolume=sc.nextint();
        System.out.println(car.trademark+"Speed"+ car.maxspeed());
    }
}

суббота, 5 ноября 2016 г.

четверг, 3 ноября 2016 г.

import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  Scanner input=new Scanner(System.in);
  int [] Numbers={-10,0,90,70,40,50,20,30,80,60,100};
  System.out.print("Enter an integer number that u want to search between 0 to 100");
  int searchItem=input.nextInt();
  int first =0;
  int last= Numbers.length - 1 ;
  boolean found=false;
  int middle;
 
  while(first<= last && !found){
  middle=(first + last)/2;
  if (searchItem==Numbers[middle] ){
  found=true;
  System.out.println("The number is in Numbers[] array index" + middle + ".");
  }else if (searchItem < Numbers[middle]){
  last=middle-1;
  } else {
  first=middle + 1;}
}
  }
}
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  Scanner input=new Scanner(System.in);
  int [] Numbers={-10,0,90,70,40,50,20,30,80,60,100};
  System.out.print("Enter an integer number that u want to search between 0 to 100");
  int searchItem=input.nextInt();
  int position =0;
  boolean found=false;
  while(position<Numbers.length&& !found){
  if (Numbers[position]== searchItem){
  found=true;
  System.out.println("The number is in Numbers[] array index" + position+ ".");
  }else{
  position=position + 1;
 
  }
 
  }
  }
}
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  Scanner input=new Scanner(System.in);
  int [] Numbers={-10,0,90,70,40,50,20,30,80,60,100};
  System.out.print("Enter an integer number that u want to search between 0 to 100");
  int searchItem=input.nextInt();
  int position =0;
  boolean found=false;
  while(position<Numbers.length&& !found){
  if (Numbers[position]== searchItem){
  found=true;
  System.out.println("The number is in Numbers[] array index" + position+ ".");
  }else{
  position=position + 1;
 
  }
 
  }
  }
}
Begin
Input calcium temperature
Add 273.5
Farenheit temperature == calcium + 273.5
Output farengeit t
End
 Begin
Input the length of the cube
Volume of the cube == length^3
Output volume
End
Begin
Input radius of the sphere
Volume of the sphere == ¾*(3.14*radius^3)
Output volume of the sphere
End
Begin
Input weather
If weather == cold
Then output == wear warm cloth
Else have a shower endif
End
Begin
Input  salary
Pension == salary * 0.18
Then output == salary * 0.18
End
Begin
Input the mark
If  mark ==” 5” endif
Then output == “A”
If  mark ==” 4”  endif
Then output == “B”
End





среда, 21 сентября 2016 г.

        INP
        STA 99
        INP
        ADD 99
        STA 98
        INP
        ADD 98
        STA 97
        INP
        STA 96
        LDA 97
        SUB 96
        STA 95
        INP
        STA 94
        LDA 95
        SUB 94
        OUT
        HLT

четверг, 8 сентября 2016 г.

import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
   Scanner sc = new Scanner(System.in);
      int[] myArray = new int[5];
       for (int i = 0; i < myArray.length; i++) {
        myArray[i]= sc.nextInt();
       }
      int max=myArray[1];
       for (int i = 0; i < myArray.length; i++) {
        if( myArray[i]>max) { max=myArray[i];
             }
      }
       System.out.print(max);
     }
}
http://computersciencegrade11nisaktobe.blogspot.com/
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    Scanner input= new Scanner(System.in);
   char symbol;
   System.out.print("Enter a character:");
   symbol=input.next().charAt(0);
   for (int i=0 ; i<=10 ; i++){
    for(int x=10 ; x >= i;x--){
     System.out.print(symbol);
    }
    System.out.println();
  }
  }
}

  Scanner input= new Scanner(System.in);
  char symbol;
  System.out.print("Enter a character:");
  symbol=input.next().charAt(0);
  for (int i=10 ; i>=0 ; i--){
  for(int x=10 ; x <= i;x--){
  System.out.print(symbol);
  }
  System.out.println();
  }
  }
}

среда, 7 сентября 2016 г.

import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    int digit;
    String digitString;
        Scanner sc = new Scanner(System.in);
        digit = sc.nextInt();
                switch (digit) {
            case 1:  digitString = "nice";
                     break;
            case 2: digitString = "nice d";
                     break;
            case 3: digitString = "niceeee";
                     break;
            case 4:  digitString = "niceeeui";
                     break;
            case 5:  digitString = "five";
                     break;
            case 6:  digitString = "six";
                     break;
            case 7:  digitString = "seven";
                     break;

                     default:digitString="invalid digit";
                     break;
                    }
        System.out.println(digitString);
                   
  }
}
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    int digit;
    String digitString;
        Scanner sc = new Scanner(System.in);
        digit = sc.nextInt();
                switch (digit) {
            case 1:  digitString = "one";
                     break;
            case 2: digitString = "two";
                     break;
            case 3: digitString = "three";
                     break;
            case 4:  digitString = "four";
                     break;
            case 5:  digitString = "five";
                     break;
            case 6:  digitString = "six";
                     break;
            case 7:  digitString = "seven";
                     break;
            case 8:  digitString = "eight";
                     break;
            case 9:  digitString = "nine";
                     break;
                     default:digitString="invalid digit";
                     break;
                    }
        System.out.println(digitString);
                   
  }
}
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  int a;
  int b;
  int c;
  int p;
  double S;
  Scanner sc = new Scanner(System.in);
   a = sc.nextInt();
   b= sc.nextInt();
   c = sc.nextInt();
   S=(a+b+c)/3;
    System.out.println('S');
  }
}