CSCI 151 - Prelab 1

Due 10am, Monday, February 11

In this prelab, you will be working on some of the isses related to the first full lab assignment. Please write up or type up your solutions and upload an electronic copy to Gradescope. Remember: no late prelabs allowed!

Unlike most of the other labs, this one will consist of a number of small programming assignments to give you a chance to become familar with programming in Java.

Return to the Pyramids

You may recall from 150 having to draw a Pyramid out of bricks. Well, this time I want you to build a pyramid out of stars! They will be symmetrical and look like:

    *    
   ***   
  *****  
 ******* 
*********
  1. Given a height N, give the loops needed to print a pyramid of that height. You may do this in Java, Python, or even pseudocode

HiLo guessing game

You and your friend (the computer) will play a guessing game. One of you will pick a number between 1 and 1000. The other one will guess numbers and the other will tell them if they guessed correctly or were too high/low.

  1. Describe the logic needed to ensure that a user types in a guess between 1 and 1000

Redaction

  1. Describe how you could accurately determine the number of lines in a text file

You'll also want to think about different ways you might be able to match words on that line. (i.e., do some String matching)


Last Modified: Feb 01, 2019 - Roberto Hoyle, based on material from Benjamin Kuperman