-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHW2.java
More file actions
23 lines (23 loc) · 704 Bytes
/
Copy pathHW2.java
File metadata and controls
23 lines (23 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.example.HW2;
import java.util.Scanner;
public class HW2 {
public static Scanner scanner = new Scanner(System.in);
static int a = scanner.nextInt();
static int b = scanner.nextInt();
static double c = scanner.nextInt();
static double d = scanner.nextInt();
public static void numTochar(int x){
System.out.println((char)x);
}
public static void numDigit(int y){
System.out.println(y % 10);
}
public static void numAverage(double z1, double z2){
System.out.println((z1 + z2) / 2);
}
public static void main(String[] args){
numTochar(a);
numDigit(b);
numAverage(c, d);
}
}