السلام عليكم
ممكن تساعدوني في تصحيح هاذي الاكواد رفعت ضغطي
1 public int maximum( int x, int y, int z )
2 {
3 int max = x;
4
5 if ( y > max )
6 y = max;
7
8 if ( z > max )
9 z = max;
10
11 return max;
12 } // end method maximum
.................................................. .....
1 import java.util.Scanner;
2
3 public class PrintNumberTest
4 {
5 public static void main( String args[] ) {
6 printProduct();
7 }
8 public void printProduct()
9 {
10 Scanner input = new Scanner( System.in );
11 int value;
12 int value2;
13 // obtain user input
14 System.out.println( "Enter a first integer: " );
15 value = input.nextInt(); // input integer from user
16
17 System.out.println( "Enter a second integer: " );
18 value = input.nextInt(); // input integer from user
19 // call method addString to return output
20 System.out.println( addString() );
21 } // end method printProduct
22
23 // the addString method
24 public String addString ( int x )
25 {
26 int product = x * y;
27 return String.format( "The product of the two integers is %d", product );
28 } // end method greet
29 } // end class PrintNumberTest
.................................................. .
1 import java.util.Scanner;
2 public class PrintStringTest
3 {
4 public static void main( String args[] ) {
5 printString();
6 }
7 public void printString()
8 {
9 Scanner input = new Scanner( System.in );
10 String value;
11 // obtain user input
12 System.out.println( "Enter a string: " );
13 value = input.nextInt(); // input string from user
14
15 // call method addString to return output
16 System.out.println( "hello" );
17 } // end method printString
18 } // end class PrintStringTest