New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Intro to Programming in Java

by: Laurianne White MD

Intro to Programming in Java CSIS 110

Laurianne White MD

GPA 3.99

Brian Hanks

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Brian Hanks
Class Notes
25 ?




Popular in Course

Popular in Computer Information Systems

This 3 page Class Notes was uploaded by Laurianne White MD on Monday October 12, 2015. The Class Notes belongs to CSIS 110 at Fort Lewis College taught by Brian Hanks in Fall. Since its upload, it has received 28 views. For similar materials see /class/221848/csis-110-fort-lewis-college in Computer Information Systems at Fort Lewis College.

Popular in Computer Information Systems


Reviews for Intro to Programming in Java


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/12/15
CSIS 110 Lecture 23 Announcements Read section 55 56 58 and 59 last time 51 to 54 Last Time Random Numbers Java includes a class for generating random numbers What is it called What package is it contained in That is where do you need to tell Java to look for the Random class in an import statement How do you create an instance of a Random How do you generate a random number create an instance of class Random call a method on that object to get a number Discuss ways that students used random numbers to select DNA characters The class Random has an overloaded constructor public Random public Random long seed Both create a random number generator The second version takes a seed value as a parameter This quotprimesquot the generator Two random number generators created using the same seed value will generate the same sequence of 39random numbers The nextlnt method returns a random number This method is also overloaded public int nextlnt iretum a random int in the range 2l47484648 to 2147484647 public int nextlnt int max iretum a random int in the range 0 to max l So how would we use a Random number generator to simulate rolling a single die How about two dice Tech Support Let s look at an application that does some String manipulation Open the techsupportl application in chapter 5 folder Go ahead and create a SupportSystem object Tell it about your computing problems It39s not a very good system is it There are 3 classes SupportSystem InputReader and Responder The InputReader class gets user input The Responder class generates a response Let39s look at the Responder class Not much here yet is there Let s examine the code of class SupportSys tem The constructor creates an InputReader and a Responder There are a couple of methods that print messages The start method does the most interesting work It has a wni l e loop What does this loop do normally read some user input get a response from the Re sponde r object print that response The loop terminates when the input begins with the String quotbyequot String method s t a rt sWi tn 7 returns true if St ri ng begins with the given parameter false otherwise You can think of this as looking for a pre x Give some examples What about nding a suf x Look it up in the Java documentation There is an endsWi tn method So ifwe run the start method on a SupportSystem object we notice that we can enter any String that begins with the sequence quotbyequot What if we enter a space rst It doesn39t work How can we x this Use the trim method What is the signature ofthis method public String trim What does that mean Modify your SupportSystem start method to use trim OK so now it works with whitespace at the beginning What if I type quotByequot or quotBYEquot What method could we use to make this work Modify your SupportSystem start method to use toLowerCas e Remember this method returns a new String 7 it doesn39t modify the original Lab Exercise Modify your Tech Support System so that it generates a random response instead of always responding in the same way Modify the Responder class as follows 1 Declare an instance variable of type Random 2 Declare an instance variable to hold the possible responses 7 use an ArrayLi st of S t r i ng s 3 Create the Random and ArrayLi s t objects in the Re sponde r constructor 4 Fill the response ArrayLi st with some messages 7 write a new method call it fi 1 1 Re spons e s that does this and call this method from the constructor 5 Use the random number generator the variable you declared in step 1 above to select and return a random message from the ArrayLi s t when generateRespons e is called Here are some example messages quotThat sounds odd Could you give me more detailsquot quotWe know about that problem To fix it simply turn off your computer and go watch TVquot quotYour description is rather vague I need more precise information about your problemquot quotDo you have your user manual handy That problem is described on page 43quot You can use these messages plus some of your own in your Tech Support System Email the file Responder j ava to me Use the subject quotLab 18quot


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.