Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java second picture is Appendix F Class Count contains a Java program that counts from 1 to 5 in English, French, and Spanish. Add this

Java image text in transcribed
image text in transcribedsecond picture is Appendix F
Class Count contains a Java program that counts from 1 to 5 in English, French, and Spanish. Add this code to a new class called Count in the Labl project. 1. Use // style comments to add a comment header at the top of the file that includes the name of the program, your name, and a brief description of what the program does, neatly formatted. Include a delimiter line (e.g., all stars) at the beginning and end of the header. Add a comment before each printin that indicates what language the next line is in. Experiment with leaving a blank line before each of these comment lines in the program itself, not the output). Is the program easier to read with or without these blank lines? 3. Remove one of the slashes from one of your comment lines and recompile the program, so one of the comments starts with a single /. What error do you get? Put the slash back in 4. Try putting a comment within a comment, so that all appears after the initial // on a comment line. Does this cause problems? 5. Consult the documentation guidelines in Appendix F of the text. Have you violated any of them? List two things that you could imagine yourself or someone else doing in commenting this program that these guidelines discourage. public class Count public static void main (String[] args) System.out.println("one two three four five"); System.out.println ("un deux troig quatre cinq"); System.out.println ("uno dos tres cuatro cinco"); Documentation Guidelines A. The Reader 1. Write all documentation as if the reader is computer literate and basically familiar with the Java language. 2. Assume the reader knows almost nothing about what the program is supposed to do. 3. Remember that a section of code that seems intuitive to you when you write it might not seem so to another reader or to yourself later. Document accordingly. B. Content 1. Make sure comments are accurate. 2. Keep comments updated as changes are made to the code. 3. Be concise but thorough. C. Header Blocks 1. Every source code file should contain a header block of documentation providing basic information about the contents and the author. 2. Each class and interface, and each method in a class, should have a small header block that describes its role. 3. Each header block of documentation should have a distinct delimiter on the top and bottom so that the reader can visually scan from one construct to the next easily. For example: header block D. In-Line Comments 1. Use in-line documentation as appropriate to clearly describe interesting processing 2. Put a comment on the same line with code only if the comment applies to one line of code and can fit conveniently on that line. Otherwise, put the comment on a separate line above the line or section of code to which it applies. 3. All functions (methods) should have preconditions and postconditions. E. Miscellaneous 1. Avoid the use of the /* style of comment except to conform to the Javadoc (/* */) commenting convention 2. Don't wait until a program is finished to insert documentation. As pieces of your system are completed, comment them appropriately. Even better...add your comment prior to entering your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions