Untitled
user_4344994
plain_text
3 years ago
2.0 kB
8
Indexable
import java.io.*;
import java.util.*;
public class Solution {
static Scanner sc = new Scanner(System.in);
static int arr[];
interface Person {
public float calculateSalary();
public void input();
}
class PersonDefine implements Person {
int type;
public void input (){
switch(type){
case 1:
}
}
}
public class Worker implements Person {
String name;
float baseSalary;
int numProduct;
public float calculateSalary(){
return this.baseSalary + numProduct*5;
}
public void input(){
name = sc.next();
baseSalary = sc.nextFloat();
numProduct = sc.nextInt();
}
}
public class Officer implements Person{
String name;
float baseSalary;
int numWork;
public float calculateSalary(){
return this.baseSalary + numWork*100;
}
public void input(){
name = sc.next();
baseSalary = sc.nextFloat();
numWork = sc.nextInt();
}
}
public class Manager implements Person{
String name;
public float calculateSalary()
{
return 100;
}
public void input(){
name = sc.next();
}
}
public static void read(int a)
{
arr = new int[a];
for (int i = 0; i < a; i++) {
int temp = sc.nextInt();
switch(temp){
case 1:
}
arr[i] = sc.nextInt();
}
}
public static void main(String args[]) {
System.out.print("Enter numbers here : ");
int a = sc.nextInt();
PersonDefine p[] = new PersonDefine[a];
System.out.println("");
}
}Editor is loading...