Skip to content
Snippets Groups Projects
Commit e870b0b2 authored by Rudi Buss's avatar Rudi Buss
Browse files

Update Exercise 5 - Farm.txt

parent 5ac04158
No related branches found
No related tags found
No related merge requests found
Do the following changes to your farm program from Chapter 3 "Exercise 2 - Farm":
Do the following changes to your farm program from Chapter 3 "Exercise 1 - Farm":
Use a switch statement to create a user menu.
The user can type in a number (0, 1 or 2) that calls one of the following functions:
Use a switch statement to create a user menu that calls the following 3 functions:
- 1: Data_query
- 2: Calculate_revenue
- 0: Exit program
The menu should reappear until the user enters the number 0 to exit the program (do-while loop).
A corresponding message should appear if a wrong input has been made.
\ No newline at end of file
- 1: Create animal ()
- 2: Display animal ()
- 3: Sell animal (animal number)
- 0: End program
The menu should reappear until the user enters the number for "End program" (do-while loop).
When creating, the following data should be saved:
- Animal type
- Animal number
- Weight
When displaying, the following data should be shown:
- Animal type
- Animal number
- Weight
- Whether the animal is still in stock
When selling, it should be checked whether the animal is still in stock and whether the stored animal number matches the entered animal number.
The following should work:
- Entering the daily price
- Revenue increases (weight * daily price)
- Output of the total revenue
- Animal is then no longer in stock
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment