Homework

Homework — the right types for your fields

YOUR app: a validated numeric field and at least one correct division.

Requirements:

  1. A menu entry that reads a number from the user: Scanlnstrconv.Atoi → validation with your own rules (bounds!). Bad input — a message and continue.
  2. At least one calculation with a division whose answer is only correct with float64 (expense average, rating average, a percentage...). Print with %.1f.
  3. Deliberately try the broken version (int division) and confirm it shows a wrong answer — then put the correct one back.
  4. gofmt + a working go run.

To submit: the code + a transcript showing: a good number accepted, abc rejected, and the division result correct.

Tip. You have the right types and a number check. Next lesson is text: formatting with fmt.Sprintf, and above all why len("ąžuolas") returns 9, not 7. Your app learns to display a record cleanly and check a title correctly. The list ([]Item) comes the lesson after.