lab4 - Lab 4 Iteration & Selection ENGR 101 Lab 4 -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 4 – Iteration & Selection ENGR 101 1 Lab 4 - Iteration & Selection In this lab, you will learn the basics of iteration (loops) and selection (if, else if, and else). This should help you create much more powerful programs that can crunch through a lot of data and make decisions. Background For this lab you will be assuming the position of a Professor that needs to do some basic data interpretation and produce some resulting statistics. Here is a familiar grading distribution for the class that you will use throughout this lab: A+ 98 ≤ % ≤ 100 72 ≤ % < 76 92 ≤ % < 98 C- 69 ≤ % < 72 A- 89 ≤ % < 92 D+ 66 ≤ % < 69 B+ 86 ≤ % < 89 62 ≤ % < 66 82 ≤ % < 86 D- 60 ≤ % < 62 B- 79 ≤ % < 82 % < 60 C+ 76 ≤ % < 79 Part 1: Selection For this part of the lab you will request the user to input their numerical score and then, using a series of if- else if-else statements, figure out what letter grade they will receive using the table above then print this to the screen. Here is an example of how the program should function when run: Below is lab4part1.cpp: 1. #include <iostream> 2. 3. using namespace std; 4. 5. int main() 6. { 7. //Declare Variables: 8. 9. //Request Input: 10. 11. //Selection & Print Statements: 12. 13. } 14. Compile and run your program. Try a few values to see if it works, good testing principles include testing all possible inputs. Most tech companies have dedicated testers that spend a large portion of their time breaking the programs they help build.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/14/2012 for the course ENGR 101 taught by Professor Ringenberg during the Fall '07 term at University of Michigan.

Page1 / 5

lab4 - Lab 4 Iteration & Selection ENGR 101 Lab 4 -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online