Sie sind auf Seite 1von 3

Assignment #6

Introduction to C Programming COP 3223

Objectives 1. To learn how to use file input and output commands Introduction: Math Academy A new tutoring center is opening in your area. The managers of this center know that math is difficult for many students, so they would like to have a number of programs to support their Math Academy. The Math Academy has hired you to help them create programs to help students learn and keep track of student progress. Problem: Areas of Focus Graph (graph.c) The students are now able to tackle a set of random problems whenever they need to practice. Now the Math Academy would like to help students identify the areas that students should focus on the most. Students have been asked to test their abilities on the random problems and record whenever they answer a problem correctly on the first try. This data is stored in a file along with the number of problems attempted. The Math Academy would like a program that can read this file and visually portray how the student is performing in different areas of focus. The areas that are considered are addition, subtraction, multiplication, and division. The program should print a small graph for the student that shows the percentage of answers correct for each area. That is, the graph should print 8 stars next to addition if the student got 80-89% of the addition questions correctly. The graph should print 6 next to addition if the student got 60-69% of the addition questions correctly, and so on. You may assume the name of the input file is input.txt. Input Specification 1. There will be no user input for this program. Input File Specification The first line of the file will be the students name. The second line of the file will contain two integers that represent the students score in addition. The first integer is the number of problems the student got correct on the first attempt. The second integer is the number of problems attempted. The third line will be for subtraction, the fourth for multiplication, and the fifth for division.

2
Sample Input File input.txt Karla 8 10 50 80 30 60 25 Output Specification The output for this program will be a graph for the student in the following format: <Name> +: <number of stars that represent percentage> -: <number of stars that represent percentage> *: <number of stars that represent percentage> /: <number of stars that represent percentage> Output Sample Below is a sample output of running the program based on the sample input file. Note that this sample is 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 Karla +: ******** -: ****** *: ***** /: **** Deliverables One source file graph.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

3
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.

Das könnte Ihnen auch gefallen