This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class DiffRadixSummator { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Enter X in Bin: "); | |
int x = in.nextInt(2); | |
System.out.print("Enter Y in Oct: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class AverageCalculator { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter the first number: "); | |
int a = in.nextInt(); | |
System.out.println("Enter the second number: "); | |
int b = in.nextInt(); | |
int c = (a/2 + b/2)+(a%2+b%2)/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class SimpleAboutMeSample { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Enter name: "); | |
String name = in.nextLine(); | |
System.out.print("Enter surname: "); | |
String surname = in.nextLine(); | |
System.out.print("Enter your age: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class NameSubstitutor { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Enter massage "); | |
String massage = in.nextLine(); | |
System.out.print("Enter name: "); | |
String name = in.nextLine(); | |
String p = "${name}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class SimpleFunctionCalculator { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter the number: "); | |
double x = in.nextDouble(); | |
double y = Math.log(Math.sin(x)+Math.pow(Math.E,x)* (Math.sqrt(x)/ Math.PI)); | |
System.out.println("Result: "+y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class MinMaxCalculator { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter the first number: "); | |
int a = in.nextInt(); | |
System.out.println("Enter the second number: "); | |
int b = in.nextInt(); | |
int m; | |
int m1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport java.util.Scanner; | |
public class IsAgeChecker { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter your age:"); | |
int age = in.nextInt(); | |
boolean x = (age>0 && age<=120); | |
System.out.println(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class AgeParser { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Enter your age: "); | |
String ageString = in.nextLine(); | |
int parserAge = new Integer(ageString); | |
if (parserAge > 0 && parserAge <= 120) { | |
System.out.println("Your age: "+parserAge); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class IdToToyConverter { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter ID of toys: "); | |
int Id = in.nextInt(); | |
if (Id == 0) { | |
System.out.println("Car"); | |
} else if (Id == 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class ToyNameToldConverter { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter name of toys: "); | |
String nameToy = in.nextLine(); | |
int IdToy; | |
switch (nameToy) { | |
case "Car": |
OlderNewer