Exemplo n.º 1
0
 public void updateOptionSetBasePrice(String modelName, String optionSetName, int price) {
   boolean makeTheRightChoice = false;
   while (makeTheRightChoice == false) {
     try {
       GasAutomobile auto = (GasAutomobile) modelSet.getAutomobile(modelName);
       auto.updateOptionSetBasePrice(optionSetName, price);
       makeTheRightChoice = true;
     } catch (CustomerExcpetion e) {
       if (e.getErrorNum() == 3) {
         optionSetName = e.newEnterForFix("OptionSet");
       }
       if (e.getErrorNum() == 2) {
         modelName = e.newEnterForFix("Automobile");
       }
     }
   }
   makeTheRightChoice = false;
 }
Exemplo n.º 2
0
 private void readFile(ModelSet modelSet, String fileName) {
   boolean readTheRightFile = false;
   while (readTheRightFile == false) {
     try {
       readFile.readModelSetFile(modelSet, fileName);
       readTheRightFile = true;
     } catch (CustomerExcpetion e) {
       fileName = e.newEnterForFix("model file");
     }
   }
 }