Review the given c code and perform analysis as needed

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

Fix C Code

The attached code, developed by a junior developer, has several issues and is not functioning as expected. The desired functionality of the program is to allow a user to select from several choices on a menu. After the user selects the "Exit" option from the menu, the program will populate a password with ‘1's and then display the value of the password. The program also captures a character so the screen can stay paused for review before exiting. Below are screen shots for a successful program execution.

Unfortunately, not only are there security issues, the code you are provided doesn't work as expected.

Carefully, review the code and perform analysis as needed. Consider the following rules and recommendations and hints for items that you might want to review.

Note, that some rules and recommendations listed below may not be found as issues in the code.

• STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator.
• MSC24-C. Do not use deprecated or obsolescent functions.
• FIO34-C. Distinguish between characters read from a file and EOF or WEOF.
• MSC17-C. Finish every set of statements associated with a case label with a break statement.
• MSC33-C. Do not pass invalid data to the asctime()function.
• MSC17-C. Finish every set of statements associated with a case label with a break statement.
• DCL20-C. Explicitly specify void when a function accepts no arguments.
• MEM30-C. Do not access freed memory.

You must use Visual Studio for C compiling.

Review and analyze the code, and determine the rules and recommendations that are violated, you should fix the code. Be sure to document each issue by aligning the rule or recommendation and explain exactly how you fixed the issue.

Tip:

1. Be very careful with the pointers and memory limits of the arrays. Most modern compilers attempt to protect your system resources, but you could potentially produce access violations that could lock your system up. Take your time and review the memory bounds for all of your arrays before your start making code changes

Submit:

Provide your fixed C source code along with a word document describing how you addressed each issue. For example, you should list the C Cert rule or recommendation for each issue and show and describe the code that addresses the issue. You should also provide screen shots and descriptions of the successful execution of the code. All references used should be included in your document.

Attachment:- C_Code.zip

Reference no: EM131112085

Questions Cloud

Determine the allowed range of the diameter of copper core : A copper-silver bimetallic wire, 1 cm in diameter, is prepared by co-extrusion with copper as the core and silver as the outer layer. The desired properties along the axis parallel to the length of the bimetallic wire are as follows: Thermal condu..
Process of designing goods and services : Summarize the process of designing goods and services, and explain where the process differs between goods and services.
Frequently enfold the biases : At least One page. This week's discussion thread is: How do you make valid strategic decisions given the reality that 1) data are usually of unknown reliability, 2) frequently enfold the biases and/or perspectives of the people who created them 3)..
Production of an online service : The following table shows the capacity required (in thousands of unspecified units) for the production of an Online service over the next 18 months.
Review the given c code and perform analysis as needed : Carefully, review the code and perform analysis as needed. Consider the following rules and recommendations and hints for items that you might want to review.
New offices at atlantic management systems : Atlantic Management System is a consulting firm that specializes in developing computerized decision support systems for computed manufacturing companies.  The firm currently has offices in Chicago, Charlotte, Pittsburgh, and Houston.  It is consi..
Calculate the value of a 5000 par value bond paying quartely : Calculate the value of a $5,000-par-value bond paying quarterly interest at an annual coupon interest rate of 10% and having 10 years until maturity if the required return on similar-risk bonds is currently a 12% annual rate paid quarterly.
According to the american diabetes association : According to the American Diabetes Association, "In 2012, 29.1 million Americans, or 9.3% of the population, had diabetes." Diabetes Mellitus can be a very debilitating disease as it can affect many organs in our body.
Developing an evidence-based argument : This part of the assignment will focus on developing an evidence-based argument to support your position on a particular topic. Be sure to use additional resources to support your paper. In a 2-page paper, make an argument on one of the prompts be..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The mean and standard deviation

How do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays.

  Write a function isperfect that returns the boolean true

Write a function isPerfect that takes an inputnas input and returns the boolean true ifn is perfect, and false otherwise.

  Write a single statement that prints a number

Write a single statement (in C++ language) that prints a number at random from each of the following set.

  Prepare a pseudocode or a flowchart

I need a pseudocode or a flowchart - MUST HAVE pseudocode OR a flowchart for the problem.

  Uses the sieve of eratosthenes algorithm

Write a complete program that uses the Sieve of Eratosthenes algorithm to list all prime numbers from 1 to 1,000 .

  Computes interest on a credit card balance

Write a C++ object oriented program which computes interest on a credit card balance. The task is done with a function that accepts initial balance, monthly interest rate, number of months for which the interest must be paid. The value returned is..

  Write an application that creates a quiz

Write an application that creates a quiz, which contains at least 5 questions about a hobby, popular music, astronomy, or any other personal interest.

  Function named sort that takes three integer parameter

Write a function named sort that takes three integer parameters by reference. The function should rearrange the parameter values so that the first parameter gets set to the smallest value, the second parameter gets set to the second smallest value, a..

  Explain function which builds the multi-dimensional vector

A separate function which outputs the multi-dimensional vector to the screen.

  What will be the output of the program

what will be the output of the program?

  Write a main function that reads pairs of positive integers

Prepare a function that has two positive integer parameters (say high and low) that returns the number of powers of two between (but not equal to) those parameters.

  Write a program to open a file in c++

Write a program to open a file in C++

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