Jump to content

Deprecated

Member
  • Posts

    41
  • Joined

  • Last visited

Awards

This user doesn't have any awards

1 Follower

About Deprecated

  • Birthday Feb 23, 1992

Contact Methods

  • Steam
    xirtama

Profile Information

  • Gender
    Male
  • Location
    Raleigh, NC
  • Occupation
    Software Development Engineer
  • Member title
    Junior Member

System

  • CPU
    3770K @ 4.6GHz
  • Motherboard
    P8Z77-V
  • RAM
    2x 8GB Patriot Viper 2133MHz
  • GPU
    2x EVGA 780ti SC
  • Case
    Corsair 550D
  • Storage
    240GB 840 Pro, 4x 4 TB WD Red drives in RAID 5 (~12TB)
  • PSU
    Corsair AX1200i
  • Display(s)
    ASUS PB278Q
  • Cooling
    3x 120mm radiators with EK blocks, res, pump
  • Keyboard
    Corsair K95
  • Mouse
    Corsair M65
  • Sound
    Ultrasone Pro 750, FiiO Olympus
  1. GUI's definitely slow down users who know what they want to happen and how to do it. No GUI is going to offer the same power as a good CLI shell
  2. a lot of unix users use many different flavors of unix actually. Macs dont really offer any advantage in using their operating system for unix hackers. Dont get me wrong, it's not a bad os, it just isnt that much better, if any, to other unix distros. For a Unix user it mostly will come down preference. Also there is several GIT GUI interfaces for linux ( http://git-scm.com/downloads/guis )
  3. checkout from your repo through your ide or install git and do it through cli
  4. you can only refer to line within the while loop in the prompt method. That's where its in scope
  5. sounds like you will have to write your own shouldnt be to hard, read up on DAO's and RMI and you should be good to go
  6. /** * Created by Tyler on 2014/10/08. */ public class Hotel { private boolean[] rooms; public Hotel(final int numRooms) { rooms = new boolean[numRooms]; } public void checkIn(int roomNum) { if (rooms[roomNum]) { System.err.println(String.format("Room #%d is already occupied!!", roomNum)); } else { rooms[roomNum] = true; System.out.println(String.format("Room #%d is now occupied", roomNum)); } } public void checkOut(int roomNum) { if (rooms[roomNum]) { rooms[roomNum] = true; System.out.println(String.format("Room #%d is now empty", roomNum)); } else { System.err.println(String.format("Room #%d is already empty!!", roomNum)); } } public boolean isOccupied(int roomNum) { return rooms[roomNum]; } } As simple as i can make it to demonstrate the idea
  7. Since we are reading a string now there really isn't any input mismatch problems (numbers can easily be represented as strings). Also Scanner.nextLine doesn't throw that exception
  8. Sounds like business requirements so you would probably find a good answer from people who have worked at hotels
  9. private static String promptUserYesNo(String prompt) { while (true) { System.out.print(prompt); String line = scanner.nextLine(); if ("Yes".equalsIgnoreCase(line) || "No".equalsIgnoreCase(line)) { return line; } System.out.println("Invalid input, valid inputs are Yes or No."); } }
  10. private static int promptUserInt(String prompt) { while (true) { try { System.out.print(prompt); return scanner.nextInt(); } catch (InputMismatchException e) { System.out.println("Invalid input, please type an integer."); } finally { scanner.nextLine(); } } } sorry it probably just needs to clear the buffer
  11. if the user input is an integer then the integer is returned from the method which will cause the flow to leave the loop. If it is not an integer then an exception is throw and caught so the error message shows and it goes back to the prompt
×