1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Supplementary tasks file processing

2 1 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

1 Chapter 9 File Processing A Review A 1 What is a file pointer? How different is it from the pointers of other types? Give an example for illustration A 2 What is a sequential access file? What is a[.]

Chapter 9: File Processing A Review A.1 What is a file pointer? How different is it from the pointers of other types? Give an example for illustration A.2 What is a sequential-access file? What is a random-access file? Make a comparison between them Give an example of their use contexts A.3 Describe the required steps for reading data from a file Give an example for illustration A.4 Describe the required steps for writing data into a file Give an example for illustration B Practice B.1 Write a program to save the following table into a file that can be later opened and read with Notepad After that, read the saved file and find the customer who bought the products the most and the customer who had the lowest value CustomerID 121 310 400 592 520 Location Ho Chi Minh City Ho Chi Minh City Da Nang Ha Noi Nha Trang ProductBought 10 15 12 Value 25.06 60 20.83 53.92 24.1 B2 Write a program to update the location of all the customers whose previous location is “Ho Chi Minh City” in B.1 and then save all the data existing and updated data back to the file B.3 Write a program to save the following table into a file that can not be read with Notepad After that, read the saved file and count the number of students in each class The result will be then written to a file that can be opened and read with Notepad StudentName AA Nguyễn BB Smith CC Kennedy DD Lưu EE Scott Class CCO1 CCO2 CCO2 CCO1 CCO2 AVG 8.3 8.1 8.2 8.4 B.4 Write a program to update the AVG of the student whose name is “CC Kennedy” from 8.2 to 8.5 in B.3 and then save all the data existing and updated data back to the file B.5 Write a program to insert another student of class “CCO1” into the resulting file in B.4 with the following information: StudentName = “AB Brown” Class = “CCO1” AVG = 8.3 B.6 Use the file processing for your assignment B.7 Check your coding style with the programs you have written Should anything be changed with your programs so that they can be not only executable but also readable? Rewrite your programs if yes

Ngày đăng: 11/04/2023, 18:46

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN