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

COP 2510 Week 7 Lecture Notes

by: Tara Copas

COP 2510 Week 7 Lecture Notes COP 2510

Tara Copas

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

Week 7 Lecture
Programming Concepts
Yan Albright and Dr. Schinnel Small
Class Notes
Java basics
25 ?




Popular in Programming Concepts

Popular in Computer Programming

This 4 page Class Notes was uploaded by Tara Copas on Sunday October 9, 2016. The Class Notes belongs to COP 2510 at University of South Florida taught by Yan Albright and Dr. Schinnel Small in Fall 2016. Since its upload, it has received 5 views. For similar materials see Programming Concepts in Computer Programming at University of South Florida.

Popular in Computer Programming


Reviews for COP 2510 Week 7 Lecture Notes


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/09/16
Programming Concepts Week 7 What to expect for Lab 6 - Lab 6 issued this week - Use Week 6 presentation for assistance (specifically slides 27­43)  The conditional operator  The do statement  The for loop  Nested loops What to expect for Midterm - Midterm Exam: Tuesday October 11 th  Closed book/Closed notes - Concepts from:  Chapter 2: Java basics including: escape sequences, assignment, primitive data types,  integer division, increment/decrement etc…  Chapter 3: String, Random, Math, NumberFormat, DecimalFormat classes  Chapter 5: logical operators, if, if­else, while statements  Chapter 6: switch statement *EXAMPLE MULTIPLE CHOICE* Answers are in red Multiple Choice - Random - Which of the following will yield a pseudorandom number in the range [­5, +5] given the following: Random gen = newRandom( );  A) gen.nextFloat()*5  B) gen.nextFloat()*10-5  C) gen.nextFloat()*5-10  D) gen.nextInt()*11-1  E) gen.nextInt(10)-5 Multiple Choice - If - Consider the following code that will assign a letter grade of ‘A’, ‘B’, ‘C’, ‘D’, or ‘F’  depending on a student’s test score. if (score>= 90) grade = ‘A’; if (score>= 80) grade = ‘B’; if (score>= 70) grade = ‘C’; if (score>= 60) grade = ‘D’;      else grade= ‘F’  A) This code will work correctly in all cases  B) This code will work correctly only if grade >= 60  C) This code will work correctly only if grade < 60  D) This code will work correctly on if grade < 70  E) This code will not work correctly under any circumstances Multiple Choice - While - In the following code, what values could be read into number to terminate the while  loop? Scanner scan = newScanner(; System.out.print(“Enter a number: “); int number = scan.nextInt(); while(number<100   number>500) { System.out.print(“Enter another number: “); Number = scan.nextInt(); }  A) Numbers less than 100  B) Numbers greater than 500  C) Numbers less than 100 or greater than 500  D) Numbers greater than or equal to 99 and less than or equal to 499  E) Numbers greater than or equal to 100 and less than or equal to 500 Multiple Choice - Switch - Given the following switch statement where x is an int: switch (x) { case 2: x += 2; break; case 4: case 5: x += 3; break; case 7: case 6: x +=1; break; } If x=4, what will the value of x be after the switch statement executes?  A) 5  B) 6  C) 7  D) 8  E) 10 Multiple Choice – While, Nested If - What is balance after the following code is executed? int balance = 10; while (balance > 0) { if (balance < 9) balance = balance ­8; else balance = balance ­1; }  A) -8  B) -1  C) 0  D) 1  E) 2 Multiple Choice – Pre/Post Increment - Given the following: int x = 15, y; y = x++ What is in x and y after the statements execute?  A) x=15, y=15  B) x=16, y=15  C) x=16, y=16  D) x=15, y=16  E) x=15, y is undetermined Tips  Practice free form questions by doing self­review exercises  Don’t throw away points!!!  Don’t get complacent with multiple choice  Read questions carefully


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."

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"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.