import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String adjective1;
String noun1;
String adjective2;
String verb1;
String adjective3;
System.out.println("Enter an adjective (description): ");
adjective1 = scanner.nextLine();
System.out.println("Enter a noun (person or thing): ");
noun1 = scanner.nextLine();
System.out.println("Enter an adjective (description): ");
adjective2 = scanner.nextLine();
System.out.println("Enter a verb ending with -ing (action): ");
verb1 = scanner.nextLine();
System.out.println("Enter another adjective (description): ");
adjective3 = scanner.nextLine();
System.out.println("\nToday I went to a " + adjective1 + " zoo.");
System.out.println("In a exhibit, I saw a " + noun1 + ".");
System.out.println(noun1 + " was " + adjective2 + " and " + verb1 + "!");
System.out.println("I was " + adjective3 + "!");
scanner.close();
}
}
wie bitte π΅
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String adjective1; String noun1; String adjective2; String verb1; Stringβ¦
12/1 hour Video in one day completed from 0 knowledge, π I know these codes simple and syntax is very similiar with another programming languagesπ
Please open Telegram to view this post
VIEW IN TELEGRAM
if (age >= 0 && age <= 18) {
alert("You are a kid, get your passport and learn something!");
} else if (age >= 19 && age <= 50) {
alert("You should work!");
} else if (age >= 51 && age <= 59) {
alert("You will retire soon!");
} else if (age >= 60 && age <= 150) {
alert("You are likely a pensioner, if you are still alive...");
} else if (age > 150) {
alert("Are you even human? ");
} else {
alert("Something went wrong!");
}Difference between JS , C codes same syntax same Values
int main() {
int age;
printf("Enter your age: ");
scanf("%d", &age);
if (age > 0 && age <= 18) {
printf("You are a kid, get your pass up and learn something!\n");
} else if (age > 19 && age <= 50) {
printf("You are ought to work!\n");
} else if (age > 51 && age <= 59) {
printf("You will get retired soon!\n");
} else if (age > 60 && age <= 150) {
printf("You are likely to be pensioner, if you are still alive...\n");
} else if (age > 151) {
printf("You are alive?\n");
} else {
printf("Something went wrong!\n");
}
return 0;
Difference between JavaScript, C, Java codes same syntax same Values!
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int age;
System.out.print("Enter your age: ");
age = scanner.nextInt();
if (age >= 65) {
System.out.println("You are a senior! ");
}else if (age >= 18) {
System.out.println("You are an adult! ");
} else if (age < 0) {
System.out.println("You haven't been born yet! ");
} else if (age == 0) {
System.out.println("You are a baby! ");
} else {
System.out.println("You are a child! ");
}
scanner.close();
}
}
wie bitte π΅
if (age >= 0 && age <= 18) { alert("You are a kid, get your passport and learn something!"); } else if (age >= 19 && age <= 50) { alert("You should work!"); } else if (age >= 51 && age <= 59) { alert("You will retire soon!"); } else if (age >=β¦
I'm not having any trouble with Java because I've also learned C and Javascript π
Please open Telegram to view this post
VIEW IN TELEGRAM
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Calculator program
Scanner scanner = new Scanner(System.in);
double num1;
double num2;
char operator;
double result = 0;
boolean validOperation = true;
System.out.print("Enter the first number: ");
num1 = scanner.nextDouble();
System.out.print("Enter an operator (+, -,/, ^): ");
operator = scanner.next().charAt(0);
System.out.print("Enter the second number: ");
num2 = scanner.nextDouble();
switch (operator){
case '+' -> result = num1 + num2;
case '-' -> result = num1 - num2;
case '*' -> result = num1 * num2;
case '/' -> {
if (num2 == 0) {
System.out.println("Cannot divide by zero!");
validOperation = false;
} else {
result = num1 / num2;
}
}
case '^' -> result = Math.pow(num1, num2);
default -> {
System.out.println("Invalid operator!");
validOperation = false;
}
}
if(validOperation) {
System.out.println(result);
}
scanner.close();
}
}
Forwarded from Azim Pulat
This media is not supported in your browser
VIEW IN TELEGRAM
I just made internet a better place with this PR https://github.com/hugomd/ascii-live/pull/2
curl ascii.live/rick
curl ascii.live/rick
Lol Javada Class nomi File nomi bilan birxil boΚ»lishi kerak ekan π€―
Btw Kotlin, C#, Swift ham shunaqa edi
Btw Kotlin, C#, Swift ham shunaqa edi
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM