代写CHEM0062: Programming Guide调试Python程序

CHEM0062: Programming Guide

An Acceptable Program should:

o Be written in Python 3

o Run without error

o Do what was asked in question and provide ‘correct’ answers

o Answers should be printed out so they can be viewed

It should not be necessary to use debugging and break points to check values

o Outputs should be clear, give units and indicate what the results are

o If Inputs are required it should be clear where to enter them and what units are expected

o Hard coding of numbers and calculations should be minimised where possible. The value of any constants should be explained with a comment

For example:

atm = 12 * 1.6605402E-27

print("Compare ease of adapting this")

print("Carbon atom mass 12 amu = ")

print(str(atm) + " kg")

print("To this")

atom_unit = 1.6605402E-27 #mass of atomic unit in kg

atom_mass = 12 #enter mass here

atm = atom_mass * atom_unit

print("Atom of mass" + str(atom_mass) + " amu = " + str(atm) + " kg")

print("The last method is more adaptable")

o Repetitive code should be replaced with loops and functions where possible/sensible.

For example:

print("Compare this output ... ")

print("1")

print("2")

print("3")

print("4")

print("5")

print("6")

print("7")

print("8")

print("9")

print("10")

print(".. to this")

for x in range(10):

print(x+1)

print("Which has simpler code")

Best Practise (in our opinion)

Minimise number of variables

Write code to make it reusable and adaptable, for example if set up to perform. calculations on 100 numbers write it so it can be extended to 1000 or 1000,000 values with only a little work.

Don’t repeat yourself. If you find yourself writing the same code more than 3 times in a row with only minor differences, consider using loops, lists, arrays, functions, etc.

Build code up slowly, make sure each part works as you go. Use print statements and breakpoints liberally (they can always be commented out). For example, if coding something with nested loops get the inner loops working first, then add the outer loops one at a time. Check to see if it breaks. (Never run before you can walk).

Remember the Chemistry/Physics of what you are trying to calculate. Compare your results to what you expect. Think about what you are doing.

Be well formatted and easy to follow.

A good way to start with a blank file is to use comments to indicate the structure

#Inputs go here

#Start of main function

#Do important step here in loop

# Prepare outputs

Then fill in around the comments with code

What we expect for the final project

· Code should be your work and you should understand how the main algorithms work.

· Use of libraries should be minimised and should not be the main component of the code.

e.g. if performing fitting of data then the routines to perform. the fit should be written by you.

· Any code to make a GUI work will not be directly marked

· If you read in files as part of the programme you should write the parsing code yourself.

· No use of AI is accepted

Table 1: Code

Grade Range

Comments

Code quality

Functionality

80 – 100

Clear, concise comments that are very well chosen to explain the code.

Functions have full explanatory text on usage following a conventional format.

All variables have meaningful consistent names.

Naming follows standard conventions.

Exemplary methods are used to solve problem.

Thought is given to future changes and made easy to do.

Very advanced methods are used.

Coding conventions are followed throughout.

The algorithms used show a high degree of originality and elegance.

Very advanced understanding of programming is shown

Program does everything correctly in an exemplary manner. Goes beyond what is expected.

Advanced Testing is shown with consideration of how future tests and uncaught problems can be found.

70 – 80

Clear comments that are well chosen to explain the code.

Functions have explanatory text on usage (docstrings).

Most variables have meaningful consistent names.

Correct methods are used to solve problem.

Thought is given to future changes.

Advanced methods are used where appropriate (keyword arguments, classes, list comprehensions).

Coding conventions are followed with few mistakes.

The central algorithms show thought and planning and are not flawed.

Advanced understanding of programming is shown

Program does everything correctly

Advanced Testing is shown, covering a large array of well-motivated inputs.

The program is easy to use.

60 – 70

Comments are mainly well chosen to explain the code.

Functions have some explanatory text on usage.

Variables are named inconsistently.

The problem is solved.

Functions and other intermediate methods are used but not correctly.

The central algorithms work but have a flaw: too simple/inefficient/hard to edit.

Understanding of programming is shown

Program is correct

Testing is performed.

The program is complicated to use.

50 – 60

Excessive comments or not enough

Functions and variables have unclear naming and usage.

Problem is almost solved or not solved well.

Some understanding of programming is shown

There is an attempt at designing a central algorithm but there are several flaws.

Program gives incorrect answers due to a more significant error.

Some testing is performed.

The program is hard to use.

40 – 50

Minimal comments

Problem is not solved.

Minimal understanding of programming is shown.

Program suffers from serious errors.

Program is incomplete.

Minimal testing shown.

0 – 40

No Comments

The problem is not solved at all.

No understanding is shown.

Program suffers from major errors.

Program does not compile.

No testing shown.

Table 2: Report

Grade Range

Report

Documentation

Results

Presentation

80 – 100

Report gives excellent context.

Overall aims explained exceptionally well.

Outstanding explanations of the code and algorithms are given.

Documentation matches all of the needs of the program excellently.

All instructions are outstandingly clear.

Example inputs and outputs are use everywhere that is appropriate.

Presented results are of an excellent level.

Results are given excellent and in-depth descriptions.

All relevant points are discussed with clear understanding shown.

Excellent well thought out structure.

English is consistently excellent standard.

Extensive links are made between text, figures or tables.

Figure presentation excellent

Excellent formatting.

70 – 80

Report gives good context.

Overall aims explained well.

Clear and concise explanations of the code and algorithms are given.

Documentation describes well how to install and use the program.

All instructions are clear.

There are some example inputs and outputs where appropriate.

Presented results are of a good level.

Results are given good descriptions.

All relevant points are discussed.

Well thought out structure.

English is consistently good standard.

Extensive links are made between text, figures or tables.

Figure presentation good

Consistent formatting.

60 – 70

Report gives context.

Overall aims given.

All key parts of the code and algorithms are explained but there are issues of clarity of conciseness.

Documentation mostly describes how to install and use the program.

Most instructions are clear.

Presented results are of an appropriate level.

Results are given largely good descriptions.

All relevant points are discussed but sometimes unclear or incorrect.

Good Structure.

English is a generally good standard.

Links are made between text, figures or tables.

Figure presentation good.

Mainly consistent formatting.

50 – 60

Report gives some context.

Overall aims given, but poorly.

Some explanations of the code and algorithms are given but with gaps.

Documentation describes how to install and use the program but poorly.

Most instructions are unclear.

Presented results are reasonable.

Results are given adequate descriptions.

Minimal discussion given.

Structured.

English is acceptable standard

Some links are made between text, figures or tables.

Figure presentation could be improved.

Inconsistent formatting.

40 – 50

Report is too brief to give context.

Overall aims unclear.

Explanations are poor/incorrect.

Documentation is severely incomplete.

None of the instructions are useable.

Presented results are below what would be expected for this course.

Results are not given adequate descriptions.

Minimal or no discussion given.

No structure.

English of poor standard.

Poor links between text, figures or tables.

Figures presented badly.

Poor formatting.

0 – 40



热门主题

课程名

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
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图