Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:

Similar presentations


Presentation on theme: "1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:"— Presentation transcript:

1

2 1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV: Initialize; Test and Update Loop Example Ch 6 Slides Loop Example Ch 6 Slides End of File Controlled Loop End of File Controlled Loop

3 2 Lab Demo Due Thu March 23 Lazy Computer Company has caused a new headache for their customers. Their models 1432, 1456 and 1273 have bad floppy drives. On the other hand, models 2432, 1456 and 2476 have bad CD-ROM drives and model 1762 needs a BIOS upgrade. Other 4-digit model numbers are ok. Develop a program that reads the model number of user’s PC from a data file and displays the type of problem in the machine. The program must also inform the user if the PC is found free from defects. Data file is given on the next slide. The program must use EOF controlled loop Lazy Computer Company has caused a new headache for their customers. Their models 1432, 1456 and 1273 have bad floppy drives. On the other hand, models 2432, 1456 and 2476 have bad CD-ROM drives and model 1762 needs a BIOS upgrade. Other 4-digit model numbers are ok. Develop a program that reads the model number of user’s PC from a data file and displays the type of problem in the machine. The program must also inform the user if the PC is found free from defects. Data file is given on the next slide. The program must use EOF controlled loop

4 3 Data File 1122 1122 1456 1456 1762 1762 2002 2002 2432 2432 2433 2433 1273 1273 3445 3445 2476 2476 4550 4550

5 4 Sample Output Please enter the data file name: models.txt Please enter the data file name: models.txt You are good You are good Bad Floppy and Bad CD Bad Floppy and Bad CD You need BIOS upgrade You need BIOS upgrade You are good You are good Bad CD drive Bad CD drive You are good You are good Bad Floppy Drive Bad Floppy Drive You are good You are good Bad CD drive Bad CD drive You are good You are good Press any key to continue Press any key to continue


Download ppt "1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:"

Similar presentations


Ads by Google