среда, 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