Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis- 4
import java.util.Scanner; public class Program { public static void main(String[] args) { System.out.println("enter y
Please explain me what error that may face by me
9 Respostas
+ 3
Thanks a lot
+ 2
package newone;
import java.util.*;
public class november29_2022_part3
public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int n-sc.nextInt();
for (int i=1;i<11; i++); {
System.out.println (i*n); }
}
0
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
int password;
0
importĀ java.util.Scanner;Ā Ā
publicĀ classĀ SumOfNumbers2Ā Ā
{Ā Ā
publicĀ staticĀ voidĀ main(StringĀ args[])Ā Ā
{Ā Ā
intĀ x,Ā y,Ā sum;Ā Ā
ScannerĀ scĀ =Ā newĀ Scanner(System.in);Ā Ā
System.out.print("EnterĀ theĀ firstĀ number:Ā ");Ā Ā
xĀ =Ā sc.nextInt();Ā Ā
System.out.print("EnterĀ theĀ secondĀ number:Ā ");Ā Ā
yĀ =Ā sc.nextInt();Ā Ā
sumĀ =Ā sum(x,Ā y);Ā Ā
System.out.println("TheĀ sumĀ ofĀ twoĀ numbersĀ xĀ andĀ yĀ is:Ā "Ā +Ā sum);Ā Ā
}Ā Ā
//methodĀ thatĀ calculatesĀ theĀ sumĀ Ā
publicĀ staticĀ intĀ sum(intĀ a,Ā intĀ b)Ā Ā
{Ā Ā
intĀ sumĀ =Ā aĀ +Ā b;Ā Ā
returnĀ sum;Ā Ā
}Ā Ā
}Ā Ā
Is this correct or not please explain me errors
0
I have a problem in my code can any one help me to slove it
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int temp = sc.nextlnt();
if(temp <=100) {
System.out.println("Boiling");
} else {
System.out.println("Not boiling");
}
}
}
0
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int cash=sc.nextInt();
if (cash < 10) {
/* code */
System.out.println("you donn't have enough money");
System.out.println("get more money");
}
else if (cash>10 && cash<50) {
System.out.println("you can get onething");
}
else{
System.out.println("you can buy both");
}
}
}
Please explain where is error...
0
// DebugFive4.java
// Outputs highest of four numbers
import java.util.*;
public class DebugFive4
{
public static void main (String args[])
{
Scanner input = new Scanner(System.in);
int one, two, three, four;
String str, output;
System.out.println("Enter an integer");
str = input.next();
one = Integer.parseInt(str);
System.out.println("Enter an integer");
str = input.next();
two = Integer.parseInt(str);
System.out.println("Enter an integer");
str = input.next();
three = Integer.parseInt(str);
System.out.println("Enter an integer");
str = input.next();
four = Integer.parseInt(str);
if(one > two > one > three > one > four)
output = "Highest is " + four;
else
if(two > one && two > three !! two > four)
output = "Highest is " + three;
else
if(three > one && three > two && three > four)
output = "Highest is " + three;
else
output = "Highest is " + four;
System.out.println(output);
}
}
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
//