首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导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:
Type>,
,
,…
• Extract the evaluation type and the grades from the line, then pass this information to
function updateGradeSet (see in task 2).
• Grades should be stored in a DYNAMIC array…..dynamic arrays are not on exam 2 but
are extremely important to learn. They were discussed in last week’s scheduled lectures.
• You should not make any assumptions about white spaces or the number of grades per
line. If the line has 0 grades, then the student gets a 0 for that evaluation type.
Hint:
• You cannot directly use the file reading code from A8 since the fields will be different but
much of that code (getting each field) will be the same.
• You will want to use the function atoi or atof to convert text to a number.
• You don’t really know where the end of the line is and the delimiter is a comma ‘,’ so
fscanf won’t work.
• If you get stuck in this step notice the provided main function has a huge chunk of
commented out code. This is code to make the grade data in code (rather than reading
from a file). Only use this if you can’t get Task 1 off the ground.
Task 2: Define updateGradeSet
If you are using the provided code, then you need to define the following function:
void updateGradeSet(GradeSet1400* p_toMod, char* a_gradeName, int*
a_grades, int numGrades);
(The following corresponds to the PROVIDED CODE. If you write the code yourself you will
probably have to take a similar approach)
• The function updateGradeSet takes a pointer p_toMod to a GradeSet1400 and modifies
one variable in p_toMod.
o For example, if a_gradeName is “QUIZ” then we call createGradeData to create
a DGrades1400 struct (the D stands for dynamic) that stores all information
about quizzes. We then save that struct to p_toMod.
o In the provided code, p_toMod->quizzes means we access the quizzes variable
in the grade set. The “->” works like the ‘.’ when using a struct (eg
“toMod.quizzes”) but for pointers. We cover this in the pointers’ lectures (the
week of the exam). We just need to touch on this a little for this assignment.
Pointers are not on the exam.
• You will have to implement other conditionals for exam1, exam2, assignments, final
exam, and labs.
If you are not using the provided code, then your program should have read in the text file and
put all grades into the GradeSet1400 struct in some way. At the end of this task you should
have all the data necessary to calculate your final grade.
Task 3: Define calcTypeGrade
double calcTypeGrade (DGrades1400 grades);
Define a function calcTypeGrade that takes a DGrades1400 struct, calculates and returns the
final grade for that evaluation type.
Example 1: if the quizzes read in were “QUIZ,100, 100, 100, 100, 100,50, 50, 100, 100, 100,
100, 25, 25, 100, 100”
Grades (dynamic) array: {100, 100, 100, 100, 100, 50, 50, 100, 100, 100, 100, 25, 25,
100, 100}
Number of grades: 15
QUIZ_GRADES_COUNTED: 12
QUIZ_PCT: 0.05
• The top 12 grades would be {100, 100, 100, 100, 100, 50, 100, 100, 100, 100, 100, 100}
• The average of these top 12 grades would be 1150 / 12, which is 95.8…these last two steps
are already done for you if you take the code from A6.
• The student’s final mark (out of 5) on the quiz is 95.8 * QUIZ_PCT (0.05), which is 4.79.
Example 2: if the average assignment grade after dropping the 2 lowest is 80%, then the
assignment mark would be 80 * ASSIGN_PCT (0.3), which is 24.0.
Task 4: Define calculateGrade
int calculateGrade(GradeSet1400 grades);
Now write a function calculateGrade that takes a GradeSet1400 and returns you final grade for
the class (out of 100).
This function should simply need to call calcTypeGrade numerous times and sum the results.
Don’t get cute: Call calcTypeGrade even if there is only 1 grade in the DGrades1400. If all the
evaluation types use the same structure you can keep using the same function.
(simple) Task 5: Miscellaneous
• Make sure you free any dynamic memory you requested. This was done for you but
commented out. Make sure freeGradeData is correct.
• Optional: Notice the function calcLetterGrade has not been defined. You can define it to get
the course letter grade based on the grade percent.
• Extra practice for exam2: not explicitly in this assignment but make sure
a) you can write a ternary expression, switch statement and do-while loop
b) you can debug and reason about code
c) You should continue to know about binary, hex, 2s complement, and pseudocode
d) Make sure you write tests for your code to show you know what kinds of cases you
might encounter.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写math 1151, autumn 2024 w...
2024-11-14
代做comp4336/9336 mobile dat...
2024-11-14
代做eesa01 lab 2: weather an...
2024-11-14
代写comp1521 - 24t3 assignme...
2024-11-14
代写nbs8020 - dissertation s...
2024-11-14
代做fin b377f technical anal...
2024-11-14
代做ceic6714 mini design pro...
2024-11-14
代做introduction to computer...
2024-11-14
代做cs 353, fall 2024 introd...
2024-11-14
代做phy254 problem set #3 fa...
2024-11-14
代写n1569 financial risk man...
2024-11-14
代写csci-ua.0202 lab 3: enco...
2024-11-14
代写econ2226: chinese econom...
2024-11-14
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!