Physics and Astronomy |
Back to top
Assessment 2 (2017)This assessment forms part of your module mark. The primary objectives of this assignment are to demonstrate the ability to :
As mentioned below, you may re-use some of your answer to the first assessment if you wish, the main aims here are the two listed above. Remember: you will make the best progress by doing the tasks in stages, making sure each stage works correctly before starting the next one. Read the Notes and Tips at the bottom before you start and be sure to ask me for help if you get stuck. Before starting you should look at our expectations page and the module's policy on copying and acceptable and unacceptable collaboration in assessments, which in turn refer to the Physics policy on cheating and plagiarism. Solving a triangleYour task is to write a program that can find the unknown sides and angles of a triangle given different combinations of input. You may re-use you sine rule code from the first assessment (we suggest taking a copy of the project and editing the copy).
Notes and tipsError checking the inputThere are several checks to be made of the users input (for example "are any of the sides or angles zero or negative?"). These can look rather long but they are very simple and do not add much to the complexity of the code. It's just a question of asking "what are all the ways the user can enter invalid data" and checking for each possibilty. Numbering the sides and anglesI suggest adopting the convention that angle N is opposite side N, (eg angle 1 is opposite side 1) in much the way that when writing out the formula if we call the sides a, b and c and the angles A, B and C then a is opposite A, etc. Output requiredThe output from your program runs should show some warnings from one or classes of non-valid input followed and the three working cases agreeing with each other. To hand inFor all assessments We require one ".c" text file for each task, uploaded to ELE. Do not upload a PDF, word-processor file etc. For each task you should hand in the program and some output pasted output into a comment at the end of your program: #include<stdio.h> int main() { // Your code here } /* OUTPUT Some output here */ The output should be fairly brief but enough to show that your code works. Basically we are looking for the minimum amount necessary to show your program worked for each separate class of the problem, including error checking where appropriate, rather than several similar runs. To copy and paste from the output terminalThe Windows output console has an "unusual" copy and paste mechanism:
You can now paste into Code::Blocks using Control-V |