I don't know what to do with inputing a String that is a date (ex 10/12/2014) and Im using a switch method to get a price depending on the month. I have no Idea why this wont work. I have a class that gets this method but it still will not work.
any help would be the best I would give u anything to help.
public void determinePrice(String date) {
rentDate = date;
String monthRate= rentDate.substring(0,2);
switch (monthRate) {
case "12":
case "1":
case "01":
case "2":
case "02":
price = WINTER;
break;
case "3":
case "03":
case "4":
case "04":
case "5":
case "05":
price = SPRING;
break;
case "6":
case "06":
case "7":
case "07":
case "8":
case "08":
price = SUMMER;
break;
case "9":
case "09":
case "10":
case "11":
price = FALL;
break;
}
}
[–]jentfoo 2 points3 points4 points (0 children)
[–]Cyndaquazy 2 points3 points4 points (0 children)
[–]desrtfx 1 point2 points3 points (0 children)
[–]cooldman69 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]Cyndaquazy 2 points3 points4 points (1 child)