Declaration first, then initialization: โdeclare to reserve, initialize to avoid garbageโ.
1D = one index (names, menor); 2D = two indices (precios: team ร provider).
While is โcheck firstโ: normalize resp with Minusculas() so โSIโ equals โsiโ.
When n hits MAX: stop writing by flipping resp to "no".
Index rule: increment first so the first team lands on index 1.
For = fixed 5; Repetir = keep asking until price > 0.
Start with provider 1 as โchampionโ; replace champion only when you find a smaller price.
Two loops = table: i makes rows, j makes columns; Sin Saltar keeps each row aligned.
While teams โ validate 5 prices โ compute min โ ask continue โ print table.
While vs Repetir for user input
| Structure | Condition check | Runs at least once |
|---|---|---|
| While | Before the body (pre-test) | No, if condition is false initially |
| Repetir...Hasta Que | After the body (post-test) | Yes, it executes once before checking |
Metti alla prova le tue conoscenze su Dairy Purchase Data Processing Course con 3 domande a scelta multipla con correzioni dettagliate.
1. What is the main purpose of declaring and initializing a variable before using it in PSeInt?
2. Why is it important to declare variables before using them in PSeInt, and what is the purpose of initializing variables after declaration?
Memorizza i concetti chiave di Dairy Purchase Data Processing Course con 9 flashcard interattive.
Variable declaration โ purpose?
Reserves memory and defines data type.
Variable declaration in PSeInt
Declares data type, reserves memory
Arrays in PSeInt โ role?
Store multiple values with indices for teams, providers, etc.
Importa il tuo corso e l'AI genera schede, quiz e flashcard in 30 secondi.
Generatore di schede