Reference no: EM132523852
ITC106 Programming Principles - Charles Sturt University
Learning outcome 1: be able to explain the steps involved in a disciplined approach to problem-solving, algorithm development and coding;
Learning outcome 2: be able to demonstrate and explain elements of good programming style;
Learning outcome 3: be able to identify, isolate and correct errors in all phases of the programming process;
Learning outcome 4: be able to interpret algorithms and program code;
Learning outcome 5: be able to appreciate and understand the concept of object orientation as an approach to data abstraction;
Learning outcome 6: be able to apply sound program analysis, design, coding, debugging, testing and documentation techniques to simple programming problems;
Learning outcome 7: be able to write code in an appropriate coding language;
Learning outcome 8: be able to examine, recognise and be aware of alternate programming approaches to include a broad discussion of procedural and object oriented approaches.
Assessment - Working with Files and Strings
TASK
After your successful development of the reward points and discount calculator, R4S has decided to further employ you to develop an additional system for storing and retrieving customer details. This system has two main programs and a module that contains the common functions used in the two programs.
Program 1: Write Customers
The first program will allow the user to enter the details for each customer, and save these details into a file specified by the user. The entered details are the customer's last name, first name, join date, and the reward points. The program must use a loop that allows the user to enter the details for additional customers. The program should also check the input for validity according to the following rules:
• Last and first names can only contain alphabetic letters.
• Join date must be in the format day/month/year and can take values from 1/1/1990 to 31/12/2020.
• The months 1, 3, 5, 7, 8, 10 and 12 must have days in the range 1 to 31.
• The months 4, 6, 9 and 11 must have days in the range 1 to 30.
• The month 2 must have days in the range 1 to 28 (ignore leap years).
• The reward points must be a valid integer number.
Program 2: Read Customers
The second program will open a file specified by the user for reading. The program will read each record from the file, split it into its component fields and check each field for validity. The rules for validity are similar to those of Program 1, with the additional rule that each record must contain exactly four fields separated by commas. Your program should print out each valid record it reads. Your program should terminate when it reads an invalid record, printing out on which line number the error occurred, and what the error/s were.
A typical example of the display of your program should be similar to the following:
Common Module
The common module should contain the common functions that are used in both Program 1 and Program 2, such as error validation functions. This module should be imported in each of Program 1 and Program 2.
You need to develop your programs by completing the following tasks:
Task 1
For each program, draw a flowchart that presents the steps of the algorithm required to perform the task specified. Note: You are only required to draw the flowchart for the main program (exactly two flowcharts are expected). Any functions used in the programs can be represented with the appropriate flowchart symbol, but are not required to have detailed flowchart representations.
Task 2
For each program, select at least three sets of test data that will demonstrate the normal operation of your program; that is, test data that will demonstrate what happens when a valid input is entered. Select two sets of test data that will demonstrate the abnormal operation of your program; that is, test data that will demonstrate what happens when an invalid input is entered or when an error is encountered.
Set it out in a tabular form as follows: test data type, test data, the reason it was selected, the output expected due to using the test data, and finally a screenshot of the output actually observed when the test data is used. It is important that the output listings (i.e., screenshots) are not edited in any way.
Task 3
Implement your programs in Python. Comment on your code as necessary to explain it clearly. Run your programs using the test data you have selected and complete the last column of test data tables above.
Note: Need to do assignment 2
Attachment:- Programming Principles.rar