首页 > > 详细

辅导BIT 1400编程、c++编程调试、辅导c/c++程序设计讲解Database|辅导R语言编程

Assignment 9 – Grade Calculator & Review
BIT 1400 Fall 2020
Objective:
Calculating your final grade (you can use this program to check your final grade) ends up
touching on strings, file I/O, structs, static arrays, loops and functions; all the content of exam 2.
Thus, don’t think of the assignment as extra work; you can think of it as preparing for the
exam…this also means you shouldn’t protest having an assignment at the same time as the
exam.
Important Note: we have done much of the work for this assignment already. Grab code from
your A6 and A8 submissions or use the provided solutions. That will not be considered cheating.
Submission:
• You will make a new .cpp file that you will submit (or modify the starter code below)
• If using the starter code, it should run and “work” before you modify it.
• Make sure your final program compiles and works.
• Be sure to include tests and comments in your code. You can make multiple different
.txt files to read in (it will be better for testing your code). In that case submit both your
.cpp and these test files in a .zip file.
• Save the .cpp file as A9_CalcGrades__F20.cpp where name is your first initial
and last name. Eg: A9_CalcGrades_DSprague_F20.cpp
• Submit your .cpp file or your .zip file to cuLearn before the deadline.
• Remember that you can submit your assignment multiple times before the deadline. We
will only grade your last submission. Therefore, you can submit partial work to make
sure you don’t run out of time.
Grading:
Part 1: Code Running (50 pts)
• Code compiling and running correctly including reading in the given .txt file (10 pts)
o The .txt file can be found here: https://drive.google.com/file/d/1lo8P8A5tO6pBZIxaPCwGRSuysokg0_Q/view?usp=sharing
• The file with the grades is successfully read in (10 pts).
• The grades are successfully stored in structs (10 pts).
• The percentage of the final grade calculated for each course deliverable works as
expected (10 pts).
• The final grade is calculated and gives the expected results (10 pts)
Note: the TAs have the right to change the input file to have a different number of assignments
or quizzes. Some course deliverables may also be missing. You can assume this will result in a
mark of 0 for the missing deliverable. You are trying to make your program as generalizable as
possible.
Part 2: Code quality (50 pts)
• Overall code quality (10 pts)
• Code format and readability (10pts for all functions)
o Code formatting and readability includes indentation and code layout.
• Appropriate comments and variable names (approx. 5pts per function, 20 pts total)
o Note this is for appropriate comments. A comment like “Declares a variable X” is
not helpful at all. Will your TA know exactly what the code is doing immediately?
If not, you should put a comment. I saw a number of excessive comments in
prior assignments.
• The code is logically correct without potential bugs (10pts total)
PROVIDED CODE:
Feel free to use the provided code to help simplify the assignment or use it as an example how
to parse strings.
https://drive.google.com/file/d/1wfPOEUpGJJZRdNYPe-FUAIvL9D-mKBtB/view?usp=sharing
Here is a sample text file to read in:
https://drive.google.com/file/d/1lo8P8A5tO6pB-ZIxaPCwGRSuysokg0_Q/view?usp=sharing
Questions:
Start
Remember to make a blank project, add a new .cpp file that contains the main method, and
then iteratively code/compile/test. You can also start with the provided starter code if you
prefer. You are expected to test all functions you write and write comments in your code to help
explain your work.
Copy the text test file Grades.txt to the course code directory (where your .cpp file is located)
and then
1. right-click the resources files folder in your Solution Explorer window,
2. select Add Existing
3. and add the text file to the project.
https://drive.google.com/file/d/1lo8P8A5tO6pB-ZIxaPCwGRSuysokg0_Q/view?usp=sharing
Make sure the file is in the same directory as your .cpp file.
Feel free to use the provided starter code which defines several functions for you. It will also
save you time from having to write many of the function comment blocks. I personally believe
using the starter code will make the task easier.
https://drive.google.com/file/d/1wfPOEUpGJJZRdNYPe-FUAIvL9D-mKBtB/view?usp=sharing
Task 1: Read in the text file.
Make sure you grab your code from A6 and A8. Your job is to write a function that reads in the
contents of a .txt file.
• For each line of the text (use fgets), the format would be:

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!