Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
1.2 kB
4
Indexable
Never
double carbCalValue = 1.0 , fatCalValue = 2.0, proteinCalValue = 3.0;


        if(selectedFoodTypeBreakfast.equalsIgnoreCase("VEG")){
          foodTypeValueBreakfast = 1.250;
        }else {
          foodTypeValueBreakfast = 1.250;
        }

        if(selectedFoodTypeLunch.equalsIgnoreCase("VEG")){
            foodTypeValueLunch = 1.250;
        }else {
            foodTypeValueLunch = 1.250;
        }

        if(selectedFoodTypeDinner.equalsIgnoreCase("VEG")){
            foodTypeValueDinner = 1.250;
        }else {
            foodTypeValueDinner = 1.250;
        }
        totalPriceBreakfast = ((proteinCalValue * etProteinBreakfast) + (carbCalValue * etCarbsBreakfast) + (fatCalValue * etFatsBreakfast)) * foodTypeValueBreakfast;
        totalPriceLunch = ((proteinCalValue * etProteinLunch) + (carbCalValue * etCarbsLunch) + (fatCalValue * etFatsLunch)) * foodTypeValueLunch;
        totalPriceDinner = ((proteinCalValue * etProteinDinner) + (carbCalValue * etCarbsDinner) + (fatCalValue * etFatsDinner)) * foodTypeValueDinner;
        totalPrice = totalPriceBreakfast + totalPriceLunch + totalPriceDinner;
        totalPrice = Double.parseDouble(format.format(totalPrice));
Leave a Comment