DEVRY CIS 170 C I L AB 3 OF 7 L OOPING Check this A+ tutorial guideline at looping For more.

Slides:



Advertisements
Similar presentations
Chapter 4 - Control Statements
Advertisements

© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 14 – Student Grades Application: Introducing.
REPETITION STRUCTURES. Topics Introduction to Repetition Structures The while Loop: a Condition- Controlled Loop The for Loop: a Count-Controlled Loop.
CPSC 171 Introduction to Computer Science 3 Levels of Understanding Algorithms More Algorithm Discovery and Design.
Programming Logic and Design Fifth Edition, Comprehensive
Chapter 5 Loops.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 4 Looping.
+ Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Chapter 5: Looping.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 5 Repetition Structures.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
CSC 1010 Programming for All Lecture 4 Loops Some material based on material from Marty Stepp, Instructor, University of Washington.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
© The McGraw-Hill Companies, 2006 Chapter 3 Iteration.
CIS 115 All Exercises Devry University (Devry) For more course tutorials visit CIS 115 All Exercises Devry University.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
Introduction to Loop. Introduction to Loops: The while Loop Loop: part of program that may execute > 1 time (i.e., it repeats) while loop format: while.
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
CIS 115 ALL EXERCISES DEVRY UNIVERSITY (DEVRY)  CIS 115 All Exercises Devry University CIS 115 ALL ILABS DEVRY UNIVERSITY (DEVRY)  CIS 115 All iLabs.
CIS 115 AID Teaching Effectively/cis115aid.com FOR MORE CLASSES VISIT
CIS 170 MART Peer Educator/cis170mart.com FOR MORE CLASSES VISIT
© 2006 Pearson Education Chapter 3 Part 2 More about Strings and Conditional Statements Loops (for and while) 1.
DEVRY CIS 115 Final Exam 1 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 321 iLab 2 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 321 iLab 2 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 115 Week 7 Lab Fireworks Stand Checkout Check this A+ tutorial guideline at
DEVRY CIS 321 iLab 7 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 2 OF 7 D ECISIONS Check this A+ tutorial guideline at decisions For.
DEVRY CIS 170 C I L AB 4 OF 7 F UNCTIONS Check this A+ tutorial guideline at For.
DEVRY CIS 170 C I L AB 5 OF 7 A RRAYS AND S TRINGS Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 6 OF 7 M ENU -D RIVEN A PPLICATION Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 7 OF 7 S EQUENTIAL F ILES Check this A+ tutorial guideline at sequential-files.
CIS 115 Slingshot Academy / cis115.com
Starter What does the following code do?
Setting up Categories, Grading Preferences and Entering Grades
SQL and SQL*Plus Interaction
Assigning Practice Tests to Your Team
Topics Introduction to Repetition Structures
Chapter 5: Control Structure
Chapter 5: Looping Starting Out with C++ Early Objects Seventh Edition
Topics Introduction to Repetition Structures
Understand the Programming Process
DegreeWorks Training Guide
CIS 115 Possible Is Everything/snaptutorial.com
CIS 170 Education for Service-- snaptutorial.com.
CIS115 Education for Service-- snaptutorial.com
CIS 115Competitive Success/tutorialrank.com
CIS 170Competitive Success/tutorialrank.com
CIS 115 Lessons in Excellence-- cis115.com. CIS 115 All Exercises Devry University (Devry) For more course tutorials visit CIS 115 All.
CIS 170 Lessons in Excellence-- cis170.com. CIS 170 Entire Course (Devry) For more course tutorials visit CIS170C All iLabs 1,2,3,4,5,6,7.
CIS 115 Education for Service-- tutorialrank.com.
CIS 170 Education for Service-- tutorialrank.com.
CIS 115 Teaching Effectively-- snaptutorial.com
CIS 170 Teaching Effectively-- snaptutorial.com
CHAPTER FIVE Decision Structures.
Designing and Debugging Batch and Interactive COBOL Programs
1. Open Visual Studio 2008.
Iteration: Beyond the Basic PERFORM
Understand the Programming Process
Problem Solving Skill Area 305.1
Using the Target Variable Inside the Loop
POS 408 Week 1 Individual Assignment Individual: Console Display Message//tutorfortune.com Click on below link to buy
Boolean Expressions to Make Comparisons
Topics Introduction to Repetition Structures
IS 135 Business Programming
CHAPTER 6 Testing and Debugging.
Presentation transcript:

DEVRY CIS 170 C I L AB 3 OF 7 L OOPING Check this A+ tutorial guideline at looping For more classes visit CIS 170 C iLab 3 of 7 Looping Lab # CIS CIS170C-A3 Lab 3 of 7: Looping Lab Overview – Scenario/Summary You will code, build, and execute a program that will use looping to determine the score for a diver based on individual judge’s scores. Learning outcomes: Become familiar with the different types of looping structures. Be able to debug a program of syntax and logic errors. Be able to use the debug step-into feature to step through the logic of the program and to see how the variables change values.Deliverables Section Deliverable Points

Display the diver's information and overall score. When the competition is complete, there is a summary reportcreated that lists the total number of divers and the average of the overall scores. Lab hints: When writing this lab, use nested loops. A nested loop is when one loop is completely contained in another loop. In an inner loop, you will read the five scores one at a time. Every time you read the score (in the loop), you will compare the score to the highest so far and also to the lowest so far so you can determine the highest and lowest scores, in addition to adding the scores up one at a time. You also need to have your program process multiple divers. Put this in an outer loop. After you process the information for one diver, prompt the user if she/he wants to process another diver. Allow the user to type either a “Y” or “y” to enter another diver's information; otherwise, exit the loop. Write an event summary by calculating and displaying the average score for all divers and the total number of divers participating. Garbage in Garbage Out (GIGO): The data being entered by the user needs to be validated. Scores by judges may range between 0 and 10. If the user enters an invalid score, display an error message, and prompt for the score again. Keep doing this until the user enters the score correctly. The degree of difficulty may range from 1.00 to Sample output from program Report to the media Event: Diving competition Enter the diver's name: Sue Jones Enter the diver's city: Dallas Enter the score given by judge #1: 45 Invalid score - Please reenter (Valid Range: )

Enter the score given by judge #1: 3 Enter the score given by judge #2: 4.5 Enter the score given by judge #3: 6.7 Enter the score given by judge #4: 89 Invalid score - Please reenter (Valid Range: ) Enter the score given by judge #4: 8 Enter the score given by judge #5: 9.2 What was the degree of difficulty? 1.9 Invalid degree of difficulty - Please reenter (Valid Range: ) What was the degree of difficulty? 2 Invalid degree of difficulty - Please reenter (Valid Range: ) What was the degree of difficulty? 1.2 Diver: Sue Jones, City: Dallas Overall score was 7.68 Do you want to process another diver (Y/N)? y Enter the diver's name: Dave Smith Enter the diver's city: Houston Enter the score given by judge #1: 5.7 Enter the score given by judge #2: 6.8 Enter the score given by judge #3: 7.6

Step 6: Program Listing and Output 45 Lab Steps Preparation: If you are using the Citrix remote lab, follow the login instructions located on the iLab tab in Course Home. Locate the Visual Studio 2010 icon and launch the application. Lab: Step 1: Requirements - DIVER Scoring Program Your State Dive Association presently scores its diving competitions with pencil and paper. They would like for you to design and develop a Dive Program in C++. The paper forms that they presently use have the following: Diver’s Name, City JudgeScore1 - The scores entered are from 0 to 10. JudgeScore2 JudgeScore3 JudgeScore4 JudgeScore5 DegreeOfDifficulty - This is assigned once for each diver. OverAllScore - The overall score is the individual diver’s scores totaled and then divided by the degree of difficulty. The highest and lowest scores are removed as they are often skewed entries. Total the three scores left, divide them by 3, and then multiply that by the DegreeOfDifficulty. The degree of difficulty ranges from 1.00 to 1.67.

Enter the score given by judge #4: 8.7 Enter the score given by judge #5: 6.7 What was the degree of difficulty? 1.1 Diver: Dave Smith, City: Houston Overall score was 7.74 Do you want to process another diver (Y/N)? n EVENT SUMMARY Number of divers participating: 2 Average score of all divers: 7.71 Press any key to continue... Step 2: Processing Logic Using the pseudocode below, write the code that will meet the requirements. Write report heading Loop as long as there are divers to process Input diver's name and city Initialize highest score, lowest score and total score Using a do-while loop input the 5 judge's scores Validate the score to ensure it is between 0 and 10 Add score to total Determine highest and lowest scores Input and validate the degree of difficulty Calculate the overall diver's score

Display the diver's information and overall score Add diver's overall score to the final score Add 1 to the number of divers Prompt the user if she wants to process another diver End-Loop Calculate the average score for all divers Display the number of divers and the average score for all divers Step 3: Create a New Project Create a new project and name it LAB3. Write your code using the Processing Logic in Step 2. Make sure to save your program. Step 4: Build Solution To compile the program, click Debug then Build solution (F7). You should receive no error messages. If you see some error messages, check the code above to make sure you didn’t key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again. Step 5: Execute the Program Once you have no syntax errors, to execute or run your program, click Debug on the menu bar and then click Start Debugging.