Programming C Assignment 7 Help
Assignment #7
Introduction to C Programming – COP 3223
Objectives
1. To learn how to write functions given specifications
2. To learn how to the use pass by value and pass by reference variables
3. Review previous concepts like if-statements and loops.
Problem: Dragon Training! (dragon_training.c)
Movies about dragons and dragon training were very popular this summer. Your friend has not stopped talking about how awesome dragons are and how cool it would be to train them. To amuse your friend, you have decided to create a dragon-training simulator using your C programming skills.
The basic idea behind the simulation is as follows:
1) You will simulate 10 days of dragon training.
2) In the beginning the user gets a new dragon with some initial statistics for strength, intellect, and agility.
3) At the beginning of each day the user receive a weather report.
4) Based on that, the user can determine which tasks their dragon should complete that day.
5) Then, the day’s activity is simulated.
After 10 days the simulation ends and the user is told whether or not they have completed training. Training may be completed earlier than 10 days if the obstacle course is completed.
A skeleton of the solution for this assignment is posted on the webcourse. You must fill in the seven functions that are currently empty. After you write each function, you should test it before moving on. The main function should not be modified for the final submission (you may modify it during testing, as long as you return it to its initial form).
Deliverables
One source file: dragon_training.c for your solution to the given problem submitted over WebCourses.
Restrictions
Although you may use other compilers, your program must compile and run using Code::Blocks. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include comments throughout your code describing the major steps in solving the problem.
Grading Details
Your programs will be graded upon the following criteria:
1) Your correctness
2) Your programming style and use of white space. Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor, you could get 10% or 15% deducted from your grade.
3) Compatibility – You must submit C source files that can be compiled and executed in a standard C Development Environment. If your program does not compile, you will get a sizable deduction from your grade.
Output Sample #1
Welcome to Dragon Training!
You've been assigned a new dragon! Would you like to give it a name? (yes/no)
yes
Great! What would like to call your dragon?
Toothful
To complete training, Toothful must finish the final obstacle course with a score of 70 or better.
You may attempt the obstacle course at any time, but you must finish within 10 days.
Better get started!
It is Day #1.
Here are Toothful's current stats:
Strength: 85
Intelligence: 1
Agility: 16
Here is today's weather forecast:
It is partly cloudy and windy.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
3
After running sprints, Toothful gained 11 agility!
It is Day #2.
Here are Toothful's current stats:
Strength: 85
Intelligence: 1
Agility: 27
Here is today's weather forecast:
It is cloudy with a high chance of rain.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
2
After hitting the books, Toothful gained 19 intellect!
It is Day #3.
Here are Toothful's current stats:
Strength: 85
Intelligence: 20
Agility: 27
Here is today's weather forecast:
It is partly cloudy and windy.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
3
After running sprints, Toothful gained 12 agility!
It is Day #4.
Here are Toothful's current stats:
Strength: 85
Intelligence: 20
Agility: 39
Here is today's weather forecast:
It is partly sunny with low humidity.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
4
Toothful scored a 76 on their obstacle course run!
Congratulations! Toothful completed their training!
Output Sample #2
Welcome to Dragon Training!
You've been assigned a new dragon! Would you like to give it a name? (yes/no)
no
To complete training, your dragon must finish the final obstacle course with a score of 70 or better.
You may attempt the obstacle course at any time, but you must finish within 10 days.
Better get started!
It is Day #1.
Here are your dragon's current stats:
Strength: 14
Intelligence: 2
Agility: 21
Here is today's weather forecast:
It is partly cloudy and windy.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
1
After lifting weights, your dragon gained 10 strength!
It is Day #2.
Here are your dragon's current stats:
Strength: 24
Intelligence: 2
Agility: 21
Here is today's weather forecast:
It is warm and sunny with medium winds.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
1
After lifting weights, your dragon gained 9 strength!
It is Day #3.
Here are your dragon's current stats:
Strength: 33
Intelligence: 2
Agility: 21
Here is today's weather forecast:
It is warm and sunny with medium winds.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
2
After hitting the books, your dragon gained 2 intellect!
It is Day #4.
Here are your dragon's current stats:
Strength: 33
Intelligence: 4
Agility: 21
Here is today's weather forecast:
It is cloudy with a high chance of rain.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
1
After lifting weights, your dragon gained 6 strength!
It is Day #5.
Here are your dragon's current stats:
Strength: 39
Intelligence: 4
Agility: 21
Here is today's weather forecast:
It's a perfect beach day. Sunny and hot!
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
2
After hitting the books, your dragon gained 4 intellect!
It is Day #6.
Here are your dragon's current stats:
Strength: 39
Intelligence: 8
Agility: 21
Here is today's weather forecast:
It is warm and sunny with medium winds.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
4
your dragon scored a 45 on their obstacle course run!
It is Day #7.
Here are your dragon's current stats:
Strength: 39
Intelligence: 8
Agility: 21
Here is today's weather forecast:
It is cloudy with a high chance of rain.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
3
After running sprints, your dragon gained 13 agility!
It is Day #8.
Here are your dragon's current stats:
Strength: 39
Intelligence: 8
Agility: 34
Here is today's weather forecast:
It is partly sunny with low humidity.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
1
After lifting weights, your dragon gained 11 strength!
It is Day #9.
Here are your dragon's current stats:
Strength: 50
Intelligence: 8
Agility: 34
Here is today's weather forecast:
It's a perfect beach day. Sunny and hot!
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
4
your dragon scored a 57 on their obstacle course run!
It is Day #10.
Here are your dragon's current stats:
Strength: 50
Intelligence: 8
Agility: 34
Here is today's weather forecast:
It is cloudy with a high chance of rain.
What would you like to do today?
1 - Train Strength
2 - Train Knowledge
3 - Train Agility
4 - Attempt the Obstacle Course
4
your dragon scored a 49 on their obstacle course run!
Sorry, your dragon did not complete training. Better luck next time.