01_lewis_409167_labMan01

01_lewis_409167_labMan01 - Chapter 1: Introduction Lab...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 1: Introduction 1 Chapter 1: Introduction Lab Exercises Topics Lab Exercises Printing strings Prelab Exercises Poem Documentation Comments Identifiers Program Names Syntax errors Recognizing Syntax Errors Correcting Syntax Errors
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Chapter 1: Introduction Prelab Exercises Your task is to write a Java program that will print out the following message (including the row of equal marks): Computer Science, Yes!!!! ========================= An outline of the program is below. Complete it as follows: a. In the documentation at the top, fill in the name of the file the program would be saved in and a brief description of what the program does. b. Add the code for the main method to do the printing. // ******************************************************************* // File Name: // // Purpose: // ******************************************************************* public class CSYes { // ------------------------------------------------- // The following main method prints an exciting // message about computer science // ------------------------------------------------- } Poem Write a Java program that prints the message, "Roses are red". Your program will be a class definition containing a main method—see the Lincoln example in Listing 1.1 of the text if you need guidance. Remember the following: & The name of the class must match the name of the file (but without the .java extension). & The main method must be inside the class definition (between the first { and the last }). & The statement that prints the message must be inside main . Compile and run your program. When it works correctly, modify it so that it prints the entire poem: Roses are red Violets are blue Sugar is sweet And so are you!
Background image of page 2
Chapter 1: Introduction 3 Comments File Count.java contains a Java program that counts from 1 to 5 in English, French, and Spanish. Save this file to your directory and compile and run it to see what it does. Then modify it as follows: 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.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

01_lewis_409167_labMan01 - Chapter 1: Introduction Lab...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online