首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写ACS130、代做C++设计编程
项目预算:
开发周期:
发布时间:
要求地区:
ACS130 Introduction to Systems Engineering and Software
C Programming Assignment Matrices
Tara Baldacchino (t.baldacchino@sheffield.ac.uk)
Assignment weighting: 15% of module mark
Assignment released: Friday 8 March (Semester 2, week 5)
Assignment due: 11.59pm Thursday 21 March (week 7)
Submission: You must submit your .c file to ACS130 Blackboard assignment dropbox
entitled. “C Program: Matrices” in the Assessment section. Do not copy your .c file into any
other format. Do not submit executable files to the assignment dropbox. Multiple
submissions to the Blackboard assignment dropbox are allowed up to the deadline.
After the deadline, your last version is the version that will be marked (you cannot
resubmit after the deadline).
You must make sure that your code runs on Codeblocks before submitting. Any code that
won’t run properly, will be marked as is which could mean you could get a 0. It is your
responsibility to submit a .c code that compiles and runs.
You will receive feedback via a rubric and a mark for your code. Provisional marks may change
as a result of unfair means and/or late submissions. I will then go over a sample solution during
a session so that you can get feedback on the code.
Assignment briefing:
This assignment will assess your ability to solve a problem using these C programming
elements: repetition (e.g. for.. or while..), selection (if), structures, two dimensional arrays,
pointers, I/O and functions. Your task is to write a C program to:
• **Allow the user to input the size of a matrix. The contents of the matrix are read in
from a file, which has a list of 100 float numbers (numbers in the file are <100.00). If
the matrix is 3x2, then the first 2 numbers in the list form the first row, the second 2
numbers in the list form the second row …and so on).
• The matrix must have between 1 and 10 columns and between 1 and 10 rows. The
matrix size (rows x columns) is determined by the user, and this information is stored
in a struct matrix (specified below) in members int nrows and int ncols.
• The contents of the matrix will also be stored in the struct matrix in member
float mValues[10][10].
• Calculate the determinant: Ask the user to choose the row and column to form a 2x2
matrix, which is a subset of the original matrix. The 2x2 matrix contents must be stored
in a new struct matrix variable, along with its size. The determinant of this matrix is
then calculated. (See sample run of program below).
• Find the inverse of the 2x2 matrix: The inverse matrix contents must be stored in a
new struct matrix variable, along with its size. ##
• Loop from ** to ##, but allow the user some way of exiting the loop and stopping the
program
The program shall define a structure to hold information about the matrices as follows (only
define one structure, but declare 3 structure variables: one for the original matrix, one for the
2x2 sub matrix and one for the inverse):
struct matrix
{
float mValues[10][10]; // to hold the values in the matrix, up to 10 rows x 10 columns
int nrows; // to hold the number of rows used in mValues
int ncols; // to hold the number of columns used in mValues
};
Notes (refer to mark scheme for more details):
1. The array that holds the matrix values has maximum size 10x10, which means that
the program must be able to work with any array up to that size. For this program, the
minimum array size allowed is 1 x 1.
2. A sample .txt file with 100 numbers is available on ACS130 Blackboard. Please note
that you will need to test your code thoroughly to cover every possible scenario (eg to
get a det=0). I will be using a different test data to test your program.
3. The program must display to the screen the contents of each matrix in the program,
after it has been input or created.
4. The program must allow both square and non-square matrices, e.g. 3 x 3 is square, 3
x 4 is not square.
5. You must program defensively. The program must guard against incorrect entries
for rows and columns at every possible instance. The program must ask the user to
enter again if incorrect. You also need to check if the input file is available. You also
need to take into consideration things like: possibility of generating a 2x2 matrix
(because the input matrix is smaller, eg, 2x1), having a 1x1 matrix, and finding the
inverse when the determinant is 0 or does not exist.
6. You cannot use global variables. You will get 0 for the whole code. #define can
be used (and encouraged).
7. You cannot use while(1) loops. You will get 0 for the whole code. You can use a
while(OK) loop where OK is a variable that is, for eg, 0 or 1
8. You cannot use break (unless it is part of a switch case).
9. You cannot use goto, continue, jump.
10. The program must include main( ) and the following 4 functions. The function
prototypes must be as follows:
void matrixInput(struct matrix *mat, FILE *in); /* to input the size (number
of rows and columns) of the matrix, and read in the values from the file (using fscanf) into the
2D array that makes up the matrix NOTE, the file opening and checking occurs in main(), eg
FILE *fin; fin=fopen(“ xyz.txt”,’r’); then use fin in the function call. */
void matrixDisplay(struct matrix mat); /* to display the values in the 2D array
that makes up the matrix*/
float matrixDeterminant(struct matrix m1, struct matrix *m2, int
*check); /* to form sub matrix m2 from m1, find the determinant of m2, where m2 is a 2x2
subset matrix of m1; returns determinant to main. If determinant is not equal to 0, check =1; if
determinant=0, check=2, otherwise check is 0 (eg when size of matrix <2x2). check variable
is needed for the inverse. This function does not display either m1 or m2. */
void matrixInverse(struct matrix m2, float determinant, struct matrix
*m3); /* to find the inverse (if possible) of the 2x2 matrix; this function does not display either
m2 or m3. */
11. You are free to add extra functions, for example, for out-of-range checks (for rows and
columns), or any other defensive programming required, but you must have the 4
functions listed above.
Figure 1: A sample screenshot of the expected output from this code.
Marking criteria: The following table lists the components/marking criteria of the assignment
and the marks available for each component.
Component Marks
Criteria A:
Have global variables been used? OR
Have while(1) loops been used? OR
Have goto, continue, jump, break (unless in a switch case) been used?
Yes/no
If YES, then give 0 for
whole program.
Criteria B:
• Does the program use the function prototypes as instructed, and are the
parameters used properly within the functions?
void matrixInput(struct matrix *mat, FILE *in);
void matrixDisplay(struct matrix mat);
float matrixDeterminant(struct matrix m1, struct matrix *m2, int *check);
void matrixInverse(struct matrix m, float determinant, struct matrix *m3);
Yes/no
If NO, then 8 mark
penalty for whole
program.
Criteria 1: Program layout and readability including things like how clear is the
code and does it have comments, including header comments, meaningful
variable names, and indentation?
/1
Criteria 2: Inputting and displaying matrix:
• Does the program allow the user to enter number of rows and columns, and
reads numbers from the file into appropriate array in struct?
• Does the program display the correct contents of each matrix to the screen?
Is the display in a sensible format?
/2
Criteria 3: Determinant of matrix>=2x2
• Does the program find the correct determinant when original matrix >=2x2?
Variable check= 1
/2
Criteria 4: Inverse of matrix>=2x2
• Does the program find the correct inverse when the determinant exists and
is not equal to 0 (Variable check= 1)?
/2
Criteria 5: Defensive Programming
• Does it check for the file?
• Does the code guard against incorrect entries at every instance: rows & cols?
/2
Criteria 6: Defensive Programming Determinant
• Determinant when original matrix < 2x2 (Variable check= 0), or determinant
is 0 (Variable check= 2)
/2
Criteria 7: Defensive Programming Inverse
• Inverse for when determinant is 0 or does not exist. /1
Criteria 8: Original Matrix 1x1
• Correct determinant and inverse of 1x1 matrix.
/1
Criteria 9: Details
• Looping through the program until user decides to quit.
• Clarity of instructions printed to the screen.
/2
Total /15
Penalties for late submission: 5% reduction in the mark for every day, or part thereof, that the
assignment is late, and a mark of zero for submission more than five days late.
How you should work: This is an individual assignment, and it must be wholly your own work. You
must not copy algorithms or code for this assignment from any other source. You must not show anyone
else your code, nor must you look at anyone else’s code, because if you do this is likely to result in
similarity in your algorithms and code. You can discuss concepts, but if discussion leads to similar code
this will be treated as an unfair means case. Please do not post assignment questions on Stack
Exchange or CSDN or anything similar. This constitutes unfair means.
Unfair means: The module leader will submit your C programs to a plagiarism checker. Any suspicions
of the use of unfair means will be investigated and may lead to penalties. See
https://www.sheffield.ac.uk/new-students/unfair-means for more information.
Extenuating circumstances: If you have medical or personal circumstances which cause you to be
unable to submit this assignment on time, please complete and submit an extenuating circumstances
form along with documentary evidence of the circumstances.
Help: This assignment briefing, the lectures and labs and the C online resources on your ACS130
reading list provide all the information that is required to complete this assignment. You need to decide
on the algorithm to solve this problem, subject to the instructions in the assignment briefing. You also
need to create and debug the C code to solve this problem. However if you need clarifications on the
assignment then please post a question on the ACS130 Blackboard discussion board. I will not
reply to assignment related emails unless the query is of a personal nature. The discussion board is an
opportunity for everyone to see the Q&A so that no one is disadvantaged.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
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
软件定制开发网!