Is the code properly commented

Assignment Help C/C++ Programming
Reference no: EM13328304

1. Variables

• Do variables have meaningful names?
• Are hard-coded numbers used instead of named constants?
• Is a variable value read only? If so is it declared const or final?
• Are all variables used?

2. Functions
• Do functions have meaningful names?
• Are all parameters used?

3. Correctness
• Are all parenthesis properly matched?
• Are brackets properly matched?
• Does each case in a switch statement terminate with a break? Is there a default case?

4. Initialization
• Are variables initialized before their first use?

5. Loops
• Do all loops successfully terminate?
• If used, do break and continue statements work correctly?
• Does the body of the loop modify the loop variables?

6. Dynamic Allocation
• Is every dynamically allocated piece of memory properly de-allocated?

7. Pointers
• Can a NULL pointer be de-referenced?

8. Comments
• Is the code properly commented?
• Do the comments accurately describe the corresponding code?

9. Defensive Programming
• Are checks made to prevent errors such as divide by zero or illegal data?

Reference no: EM13328304

Questions Cloud

Determine what yield to maturity is the bond offering : A 7.05 percent coupon bond with 17 years left to maturity is offered for sale at $1,045.30. What yield to maturity is the bond offering
Describe the oxidizing and reducing agents : Complete and balance the following equation: BrO3^-(aq)+N2H4(aq) -> Br2(l)+N2(g) (acidic solution) And identify the oxidizing and reducing agents from the resulting balanced equation.
What is the time it takes for the suitcase to reach ground : A suitcase falls out of an airplane which is 400 meters above the ground. What is the time it takes for the suitcase to reach the ground
Calculate the bonds default risk premium : Dakota Corporation 15-year bonds have an equilibrium rate of return of 10 percent. For all securities, the inflation risk premium is 1.50 percent and the real interest rate is 3.00 percent.
Is the code properly commented : Does each case in a switch statement terminate with a break? Is there a default case?
Explain an alkane with the molecular formula c5h12 : Identify an alkane with the molecular formula c5h12 that forms only one monochlorinated product when heated with Cl2
What is change in price the bond will experience in dollars : A 5.95 percent coupon bond with fifteen years left to maturity is priced to offer a 6.9 percent yield to maturity. You believe that in one year, the yield to maturity will be 6 percent. What is the change in price the bond will experience in dolla..
How much kinetic energy does the ball have : Professional baseball pitchers can deliver a pitch which can reach the blazing speed of 100 mph (miles per hour). how much kinetic energy does the ball have
Explain what is the speed of the proton : A proton in a linear accelerator has a de Broglie wavelength of 149\rm pm . What is the speed of the proton?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Properly store the number from variable value

1. Statement will properly store the number from variable  value  into the output file object AnsFile?

  Using visual c++ and your opengl configured environment

Using Visual C++ and your OpenGL configured environment, write an application that uses OpenGL Raster transformations to draw a triangle of your choice of size, location and color, and then rotate that triangle by 90 degrees and scale it by a fact..

  By a minimal interpretation that makes a formula

By a minimal interpretation that makes a formula true, we mean that if one atom is removed from the interpretation then the resulting interpretation does no longer make the formula true.

  Write the code

Write a program that allows an instructor to keep a grade book. Each students has scores for exams, homework assignments, and quizzes.

  Accepts a pointer to a c-string as an argument

Write a function that accepts a pointer to a C-string as an argument and capitalizes the fist character of each sentence in the string. For instance, if the string argument is "hello

  Create a text adventure game that uses pointers

To get full credit for this program, you will need to use a pointer to a pointer to a string object, and utilize at least one constant pointer. You must use the pointers in if statements to decide if you win or lose the gold, and you must use func..

  Program to add numbers and display sum

For each of problems write C++ code to do the required task. Receive the number and find out whether it is odd or even.

  Develop a basic temperature class

You have to develop a basic temperature class

  Inserts a node with info value x

Complete the code for a function that inserts a node with info      value x before, and a node with info value zafter,each node with      info value y in a linked list with first node pointer p.

  Write a c program to search a list of integers

Write a C program to search a list of integers for a particular value. The user should be prompted to enter the value to be searched for. Your program will then print out whether the value was found or not.

  Declare a pointer to an array of 500 school

In a main() demonstration function, declare a pointer to an array of 500 School objects and include code to handle any memory allocation errors that occur. in a loop, declare 500 array objects at a time, continuing to rewrite the main() functions ..

  Write a program that calculates net pay

Write a program that calculates Net Pay. It should do this by calling a function called CalNetPay that calculates and returns Net Pay when given the hours worked and the hourly pay rate. The main function should pass the hours worked and pay rate ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd