Objectives of previous home works
– File I/O
– Arrays
Problem Description:
Data files called iddata.txt (Name and ID) and temp,txt (average temperature for 7 days of a
week, for 4 weeks) are given. Your program must ask the user for name and id number and
check it with the list in iddata.txt file, if the name and id matches one of the names and id in the
list, program should display the name and the id then allow the user access to the program. Then
your program must read the temperature for each week and display the average temperature for
each week.
Program input
Text files
Program output
1. Valid name and id
2. Average for each week
Output Example
Name ID
======== =========
Amber 1234
Jake 5678
David 9999
Tarzan 4444
…….. …………
Week 1 average = ?????
Week 2 average = ?????
………………….
…………………….
Requirement:
3. Must have at least two functions including main
4. Must ask user for name and id until user enters the correct combination of name and id
write a code by using files and arrays

0 comments