review the following code iscuss at least three reasons why the code is poorly formatted, Computer Science Assignment Homework Help

User Generated

ivpfzhes

Other

Description

Please review the following code below. List and discuss at least three reasons to why you believe the code is poorly formatted. Once you have identified any formatting issues, rewrite the program to include what you believe to be accurate.  Feel free to run the code in Visual Studio C++ to see the output. (100 points)

#include

int main()

{

int x1, x2, x3;

  printf("Centigrade to Fahrenheit temperature table\n\n");

  for(x1 = -2 ; x1 <= 12 ; x1 = x1 + 1)

  {

  x3 = 10 * x1;

  x2 = 32 + (x3 * 9) / 5;

  printf("  C =%4d  F =%4d  ", x3, x2);

  if (x3 == 0)

  printf(" Freezing point of water");

  if (x3 == 100)

  printf(" Boiling point of water");

  printf("\n");

  }

  return 0;

}


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

1) line 1 #include  -> it should be #include <stdio.h>2) Proper indentation of the code is absent3) 2 if statements are used instead of if - else if statement4) comments are absent in th...


Anonymous
Very useful material for studying!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags