Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.61 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package hwk5_taylen_schmaltz;
  7.  
  8. /**
  9.  *
  10.  * @author tayle_000
  11.  */
  12. public class DeptName {
  13.  
  14.     private String department;
  15.     private String location;
  16.  
  17.     public DeptName(int dptNum) {
  18.  
  19.        
  20.  
  21.         switch (dptNum) {
  22.  
  23.             case 10010:
  24.                 department = "Purchasing";
  25.                 location = "Auburn Hills";
  26.                 break;
  27.             case 10020:
  28.                 department = "Sales";
  29.                 location = "Rochester Hills";
  30.                 break;
  31.             case 10030:
  32.                 department = "Training";
  33.                 location = "Auburn Hills";
  34.                 break;
  35.             case 20010:
  36.                 department = "IT";
  37.                 location = "Rochester Hills";
  38.                 break;
  39.             case 20015:
  40.                 department = "IT";
  41.                 location = "Auburn Hills";
  42.  
  43.             case 20020:
  44.                 department = "Operations";
  45.                 location = "Auburn Hills";
  46.                 break;
  47.             case 20030:
  48.                 department = "Engineering";
  49.                 location = "Rochester Hills";
  50.                 break;
  51.  
  52.             default:
  53.                 department = "Invalid dept. number";
  54.                 location = "Invalid dept. number";
  55.  
  56.         }
  57.  
  58.     }
  59.  
  60.     public String getDepartment() {
  61.         return department;
  62.     }
  63.  
  64.     public String getLocation() {
  65.         return location;
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement