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

Notes for the Week of February 22nd

by: Amanda Howard

Notes for the Week of February 22nd CSC 111A

Marketplace > Wake Forest University > ComputerScienence > CSC 111A > Notes for the Week of February 22nd
Amanda Howard
GPA 3.48

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

These notes cover pseudocode and most of loops.
Intro CS-Genl Purpose Java
Prof Daniel A. Canas
Class Notes
Comp Sci, java, CSC, loops, pseudocode
25 ?




Popular in Intro CS-Genl Purpose Java

Popular in ComputerScienence

This 4 page Class Notes was uploaded by Amanda Howard on Sunday February 21, 2016. The Class Notes belongs to CSC 111A at Wake Forest University taught by Prof Daniel A. Canas in Winter 2016. Since its upload, it has received 20 views. For similar materials see Intro CS-Genl Purpose Java in ComputerScienence at Wake Forest University.


Reviews for Notes for the Week of February 22nd


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: 02/21/16
February 23, 2016 Pseudocode  Good programming practice  Start with an English­like design o Short pieces of code at a time o For example: start with initializing variables  Until you have the algorithm in a Java­like language  Example:  o Problem Statement: A college offers a course that prepare students for the state licensing  exam for real­estate brokers. Last year, ten of the students who completed the course took the exam. The college wants to know how well its students did on the exam. You’ve been asked to write a program to summarize the results. You’ve been given a list of 10  students. Next to each name is written a 1 if the student passed or a 2 if the student failed. o Your program should analyze the results of the exam as follows:   1­Input each test result (i.e., a 1 or a 2). Display the message “Enter result” on the screen each time the program requests another test result.   2. Count the number of test results of each type.   3. Display a summary of the test results, indicating the number of students who  passed and the number who failed.   4. If more than eight students passed the exam, print “Bonus to instructor!” o After reading the problem statement, we make the following observations   1­The program must process test results for 10 students. A counter­controlled  loop can be used, because the number of test results is known in advance.   In this case a variable to which 1 is added for every student added, the  loop is repeated until the counter=1  2. Each test result has a numeric value—either a 1 or a 2. Each time it reads a test result, the program must determine whether it’s a 1 or a 2. We test for a 1 in our  algorithm. If the number is not a 1, we assume that it’s a 2.  3. Two counters are used to keep track of the exam results—one to count the  number of students who passed the exam and one to count the number who  failed.   If 1 add 1 to numPass  Else add 1 to numFail  4. After the program has processed all the results, it must decide whether more  than eight students passed the exam.  Another if statement o First step is to initialize variables  numPass­ counter to store the number of students who pass  numFail­ counter to store the number of students who fail  numStudents­ counter for the number of students o Next step is to input and count the passes and failures  Loop to input exams until numStudents=10  If statement in the loop to add 1 to numPass if 1 is inputted  Else to add 1 to numFail if 2 is inputted  Add 1 to numStudents either way o Print the final results  Print passes  Print failures  If more than 8 students passed print “Bonus to the Instructor!” o Full Pseudocode Initialize passes to zero  Initialize failures to zero  Initialize student counter to one  While student counter is less than or equal to 10 Prompt the user to enter the next exam  result  Input the next exam result  If the student passed Add one to passes  Else  Add one to failures  Add one to student counter  Print the number of passes  Print the number of failures  If more than eight students passed  Print “Bonus to instructor!” for loops  iterate statement several times using a counter variable  a shortcut for loops  for (initialExpression; conditionExpression; updateExpression) { //loop body: Statements to execute if the conditionExpression is true } //Statements to execute if the expression is false o o i is undefined outside the loop, it’s only a counter in the loop o N can be replaced with arithmetic expressions o The control counter (i) can also be made to count in increments  Example:  Vary the control variable from 20 to 2 in decrements of 2.  for (int i = 20; i >= 2; i ­= 2)  Nested for loops o o A loop within a loop February 25, 2016 Break and Continue  Break (in a loop)­exits loop o In a nested loop use breaks to end the initial loop o  Continue­jump to loop condition Enumeration  Store a set of values  Produces a set using: Public enum setName {setName1, setName2,…etc} 


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

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

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

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

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.