Question
Objectives Assignment #2 Introduction to C Programming COP 3223 1. To give students practice at typing in, compiling and running simple programs. 2. To reinforce
Objectives
Assignment #2 Introduction to C Programming COP 3223
1. To give students practice at typing in, compiling and running simple programs. 2. To reinforce knowledge of assignment statements and arithmetic expressions 3. To learn how to use if statements for conditional execution.
Introduction: Ninja Academy
Ninjas are awesome! Your friend has not stopped talking about how cool ninjas and how they would like to become a ninja. To amuse your friend, you have decided to create a series of programs about ninjas.
Problem: Joining the Academy
Now that your friend has reached the academy, they will have to petition to join. They will be asked a series of questions to determine their suitability for ninja training. Based on your friends answers the program should print whether or not they will be allowed to train.
They will be asked two questions: 1. Are you afraid of the dark? 2. Do you exercise?
If the user indicates yes to the second question, the program should ask them how many minutes a day they exercise.
Based on these responses, you will need to determine if they are a good fit for ninja training. If the user is afraid of the dark, they should not become a ninja. If the user does not exercise or exercises for less than 10 minutes a day, they should not become a ninja. Otherwise, you should assume they are ready to begin training.
Input Specification
1. The answer to each of the two questions will be either Y to indicate yes or N to indicate no. 2. The answer to the number of exercise minutes will be an integer >= 0.
Output Specification
The output should be a single line that tells the user whether or not they will be allowed to enter ninja training.
You may begin training as a ninja!
Or:
You may not train as a ninja.
Output Sample
Below are some sample outputs of running the program. Note that these samples are NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given above.
In the sample run below, for clarity and ease of reading, the user input is given in italics while the program output is in bold. (Note: When you actually run your program no bold or italics should appear at all. These are simply used in this description for claritys sake.)
Sample Run #1 Are you afraid of the dark? N Do you exercise? Y How many minutes do you exercise per day? 15 You may begin training as a ninja!
Sample Run #2 Are you afraid of the dark? Y Do you exercise? Y How many minutes do you exercise per day? 15 You may not train as a ninja.
Sample Run #3 Are you afraid of the dark? N Do you exercise? Y How many minutes do you exercise per day? 9 You may not train as a ninja.
Deliverables
One source files ninjaeval.c is to be 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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started