Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Does every line of code require a formal C comment? 2) What is the purpose of

ID: 3531428 • Letter: 1

Question

1) Does every line of code require a formal C comment?

2) What is the purpose of data input?

3) If you want to input a single character from the keyboard what C statement might I use?

4) If you want to input a single integer from the keyboard what C statement might I use?

5) If you want to input a string of characters (including spaces) from the keyboard what C statement should I use?

6) In a C program what is the purspose of comments?

7) Write a C comment with the text: This is a comment.

8) Why should variable names be meaningful when reasonable?

9) Why is it acceptable to define multiple variables on one line in your source code?

10) What is the only required function on a C program?

11) What is meant by the term: modular design?

12) Define the program structure: Sequence.

13) Define the program structure: Selection.

14) Define the program structure: Iteration (looping)

15) What is a syntax error?

16) What is a logic error?

17) What is a runtime error?

18) In C, what is a variable?

19) What is the purpose of vertical and horizontal spacing in source code?

20) What characters define a code block (block of code) in your C program?

21) In C, what is an operator?

22) Why is it important to know or understand operator precedence in C?

23) which has higher precedence '*' (multiplication) or '+' (addition)?

24 In C what is (define) an expression?

25) In your C source code how do you turn a properly formatted expression into a statement?

Explanation / Answer

1) No

2) program gives output based on processed input

3) getchar

4) scanf("%d",...)

5) scanf("%s",...)

6) so that any person can understand the code after reading it

7) //This is a comment.

8) so that it makes understanding the code easier and reduces the possibility of bugs in program

9) No other reason than it is allowed in C program (by compiler)

10) main

11)Modular design, or "modularityin design", is an approach that subdivides a system into smaller parts (modules) that can be independently created and then used in different systems to drive multiple functionalities.

12) statements are executed sequentially

13)In "selection" one of a number of statements is executed depending on the state of the program. This is usually expressed withkeywordssuch asif..then..else..endif,switch, orcase.

14)In "iteration" a statement is executed until the program reaches a certain state, or operations have been applied to every element of a collection.

15) program does not follow certain syntax which is necessary for the compiler to compile the program

16)Incomputer programming, alogic erroris abugin a program that causes it to operate incorrectly, but not to terminate abnormally (orcrash).

17) it occurs during running of program

18) it stores the value or data

19) to make code easier to understand

20) curly braces

21) operators operate on operands to give meaningful results

22) understanding operator precedence causes the use of less round brackets and code looks simpler

23) multiplication

24)ExpressionsinCare basically operators acting on operands

25) at the end put a ;