Lab4 - Lab#4 CSE110 Arizona State University Topics Using conditional(if if-else statements Chapter 3 Using loops Chapter 4 Coding Guidelines Give

Lab4 - Lab#4 CSE110 Arizona State University Topics Using...

This preview shows page 1 - 3 out of 5 pages.

Lab #4 CSE110 - Arizona State University Topics Using conditional ( if , if-else ) statements - Chapter 3 Using loops - Chapter 4 Coding Guidelines Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc). Keep identifiers to a reasonably short length. Use upper case for constants. Use title case (first letter is upper case) for classes. Use lower case with uppercase word separators for all other identifiers (variables, methods, objects). Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to indent. Use white space to make your program more readable. Use comments after the ending brace of classes, methods, and blocks to identify to which block it belongs. Assignment/Lab Documentation At the beginning of each programming assignment you must have a comment block with the following information: /*------------------------------------------------------------------------- // AUTHOR: your name // FILENAME: title of the source file // SPECIFICATION: description of the program // FOR: CSE 110- Lab #4 // TIME SPENT: how long it took you to complete the assignment //-----------------------------------------------------------*/ Getting Started Create a class called Lab4 . Use the same setup for setting up your class and main method as you did for the previous assignments. Be sure to name your file Lab4.java . Hints Example of using a loop to read in sentinel values can be found in Section 4.5 of the book as well as the example videos for the week. The instructions below follow the example in the sample video. Examples of loops for various tasks can be found in Section 4.7 of the book as well as the videos for the week. 1
Image of page 1
Part 0: Task Overview The overall goal of this lab is to continually read in integers, one at a time, from the user until a 0 is entered. 0 should not be counted as an input, but rather is a sentinel used to stop the loop. At this point, if the user entered any values (besides 0) the following output should be displayed: A line stating the smallest integer the user entered
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '08
  • Kim
  • Negative and non-negative numbers, Parity, Evenness of zero

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture