среда, 16 ноября 2016 г.
вторник, 15 ноября 2016 г.
воскресенье, 13 ноября 2016 г.
четверг, 10 ноября 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());
}
}
* 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;}
}
}
}
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;
}
}
}
}
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;
}
}
}
}
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
воскресенье, 30 октября 2016 г.
воскресенье, 9 октября 2016 г.
среда, 5 октября 2016 г.
среда, 21 сентября 2016 г.
четверг, 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);
}
}
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);
}
}
Подписаться на:
Сообщения (Atom)


