the problem of the error is due to the fact that the indicated variables are indicated after but one depends on the other. how can i solve? I also tried to create some functions but I don't get the values. can you help me find the solution? Thank you.
the error is present in: let resultTotSale = numSale / (100 * resultTotFarina).
let resultTotFarina = resultPanetti - resultTotAcqua - Double(resultTotSale)
code: import UIKit
class DosiViewController: UIViewController{ ....
var numberPanetti = 0
var numberPeso = 0
var numberSale = 0
var numberAcqua = 0.0
var numberLievTa = 0
var numberTa = 0
var acquaInPerc = "0"
var totPanetti = "0"
var totFarina = "0"
var totSale = 0.0
var nettoPanetti = "0"
var totalPeso = 0
var totalAcqua = 0.0
var totalPanetti = 0
@IBAction func stepperPanettiValue(_ sender: UIStepper) {
numeroPanetti.text = String(format: "%.0f", sender.value)
numberPanetti = Int(sender.value)
}
@IBAction func stepperPesoValue(_ sender: UIStepper) {
numeroPeso.text = String(format: "%.0f", sender.value)
numberPeso = Int(sender.value)
}
@IBAction func stepperSale(_ sender: UIStepper) {
numeroSale.text = String(format: "%.0f", sender.value)
numberSale = Int(sender.value)
}
pizzas: I enter the number of blocks I enter the weight in grams I enter the percentage of salt I enter the percentage of water those calculations are used to have: total weight of the blocks. (number of blocks * weight) total percentage of salt to put on the dough. (flour to use: 100 * percentage of added salt)) total percentage of water. (flour to use: 100 * percentage of water added) total flour to use. (total blocks - water - salt)
example: 2 loaves of 50 gr.
total 100 grams of dough 50% water 23 grams of water 26 grams of flour 0.5 grams of salt 0.5 grams of yeast
thank you