Question
Objectives Assignment #7 Introduction to C Programming COP 3223 Problem: Codebreaking! (codebreaker.c) You are almost ready to graduate from the Ninja Academy. Only one set
Objectives
Assignment #7 Introduction to C Programming COP 3223
Problem: Codebreaking! (codebreaker.c)
You are almost ready to graduate from the Ninja Academy. Only one set of lessons remains: code breaking. You will need to learn how to break numerical codes of varying lengths and difficulties.
The basic idea is this:
1) You begin by selecting a length and difficulty for the code. A set of numbers will be generated.
2) You will guess the magnitude and placement of each of the numbers.
3) Anything exactly correct will be revealed.
4) Anything with the correct value will be noted, but not revealed.
5) You can guess as many times as you want.
When the correct code is entered, the program will end.
A scaffold for this program has been provided below. You must fill in the eight 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). Descriptions of each function are given in the scaffold along with the function Pre- and Post-conditions. The output samples at the end of this document show the wording you should use and how the program should run when completed. Also, make sure you include comments throughout your code describing the major steps in solving the problem.
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 #2 Welcome to Codebreaker Training! You will be presented with a set of hidden values. Your job is to guess these values and their correct order. After each guess you will be given feedback.
Values that are correct in magnitude and in the correct location will be revealed. These are perfect matches.
Thenyouwillbetoldhowmanyothernumbersarecorrectinmagnitudeonly. Theseareimperfect matches. No additional information will be revealed.
Choose a length for the code (5-10 numbers).
3
Choose a length for the code (5-10 numbers).
11
Choose a length for the code (5-10 numbers).
5
Choose a difficulty (1, 2, or 3).
0
Choose a difficulty (1, 2, or 3).
5
Choose a difficulty (1, 2, or 3).
3
There are 5 numbers ranging from 1 to 9.
------------ Enter your guess: 12345 You have 2 perfect matches and 1 imperfect matches.
12--- Enter your guess: 12434 You have 3 perfect matches and 0 imperfect matches.
124-- Enter your guess: 12467 You have 3 perfect matches and 1 imperfect matches.
124-- Enter your guess: 12476 You have 4 perfect matches and 0 imperfect matches.
124-6
Enter your guess: 12486
You have 4 perfect matches and 0 imperfect matches.
124-6 Enter your guess: 12496 You have 5 perfect matches and 0 imperfect matches.
Congratulations! You guessed all the values!
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