Introduction - Introduction to Java Programming Lab...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Java Programming Lab Exercises Topics Lab Exercises Printing strings Prelab Exercises Poem Syntax errors Recognizing Syntax Errors Correcting Syntax Errors Introduction 1
Image of page 1

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

View Full Document Right Arrow Icon
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 author, date written, 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. // ******************************************************************* // AUTHOR: // DATE: // 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: o The name of the class must match the name of the file (but without the .java extension). o The main method must be inside the class definition (between the first { and the last }). o 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!
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern