ITC106 Programming Principles Assignment

Assignment Help Python Programming
Reference no: EM132443777

ITC106 - Programming Principles - Charles Sturt University

Assessment - Working with Files and Strings

TASK

After your successful development of the parking rate calculator, SPA has decided to further employ you to develop an additional system for storing and retrieving parked car details. This system has two main programs and a module that contains the common functions used in the two programs.

Program A

The first program will allow the operator to enter the details for each car parked during the day, and save these details into a file named 'cars-parked-w.txt'. The entered details are the car plate number, the car entrance time in hours:minutes and the car exit time in hours:minutes. The program must use a loop that allows the operator to enter another car details. The program should also check the input for validity according to the following rules:
• Car plate number must be an alpha numeric string of exactly six digits (e.g. ABC123).
• Car entrance and exit times must be in the format hours:minutes and can take values from 00:00 to 23:59.
• The exit time must be greater than the entrance time.

The file should record each car information on a single line so that the output file has the following appearance:
ABC123,13:30,16:20
WX89YZ,04:05,11:17
A typical example of the display of your program should be similar to the following:
-------------------------------------------------
Superstar Parking Australia (SPA) Car information
-------------------------------------------------

Car plate number : ABC 123
Enterance time : 13:30
Exit time : 16:20

Do you want to enter another car? (y/n): y

Car plate number : WX 89 YZ
Enterance time : 04:05
Exit time : 11:17

Do you want to enter another car? (y/n): n

Goodbye.
-------------------------------------------------
In case of an invalid input, the display should be similar to the following:
...

Car plate number : ABC-123
Invalid input! Car plate number must be an alpha numeric string.

Car plate number : ABC 123

...

Program B

The second program will open a file 'cars-parked-r.txt' for reading and read each record, splitting it into its component fields and checking each field for validity. The rules for validity are similar to those of Program A, with the additional rule that each record must contain exactly three 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 was.

A typical example of the display of your program should be similar to the following:
-------------------------------------------------
Superstar Parking Australia (SPA) Car Information
-------------------------------------------------

Car (1) Details
-------------------------------------------------
Car plate number : ABC123
Enterance time : 13:30
Exit time : 16:20

Car (2) Details
-------------------------------------------------
Car plate number : WX89YZ
Enterance time : 04:05
Exit time : 11:17

-------------------------------------------------
End of Car Information
-------------------------------------------------
In case there is a record with an invalid data, for example:
ABC123,13:30,16:20
WX89YZ,04:05,44:17
The output should be similar to the following:
-------------------------------------------------
Superstar Parking Australia (SPA) Car Information
-------------------------------------------------

Car (1) Details
-------------------------------------------------
Car plate number : ABC123
Enterance time : 13:30
Exit time : 16:20

-------------------------------------------------
Invalid record at line (2)!
Time can only take values from 00:00 to 23:59.
-------------------------------------------------
Common Module

The common module should contain common functions that are used in both Program A and Program B, such as error validation functions. This module should be imported in each of Program A and Program B.

You need to develop your programs by completing the following tasks:

Task 1
Draw a flowchart that presents the steps of the algorithm required to perform the task specified.

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.

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.

RATIONALE

This assessment task will assess the following learning outcome/s:
- be able to identify, isolate and correct errors in all phases of the programming process.
- be able to apply sound program analysis, design, coding, debugging, testing and documentation techniques to simple programming problems.
- be able to write code in an appropriate coding language.
- be able to examine, recognise and be aware of alternate programming approaches to include a broad discussion of procedural and object oriented approaches.

This assessment task is designed to reinforce topic material related to simple functions, files, exceptions and lists.

Attachment:- Programming Principles.rar

Verified Expert

This is a python programming project which demonstrate the concept of file handling and string handling in python. In this assignment we first create a program to write the details of car parking details in a text file.The data is inputted from the user and after proper validation, the data is written to the text file. Next, we read the data file and display the records in screen.

Reference no: EM132443777

Questions Cloud

What are the thoughts on happiness : What makes you happy? What do people think makes them happy/unhappy? What are your thoughts on happiness?What is the overall thesis and main ideas of the source
What aspects of cerebral circulation would come : Fifty-four-year-old Fred is complaining of a headache that started about 2 weeks ago. For the past 2 days, the headache has increased in severity.
Nature of different types of alliances : Why do you think firms have become more reliant on alliances in recent years? Be sure to discuss the nature of different types of alliances as part
Outline and criteria for opportunity register : Opportunity Description: What is the product or service you are offering; what need does the product or service satisfy; who is the primary group of constituent
ITC106 Programming Principles Assignment : ITC106 Programming Principles Assignment Help and Solution, Charles Sturt University - Assessment Writing Service - Develop an additional system for storing
What is your personal philosophy of nursing : This week's discussion posts will somewhat mirror your paper assignment. It is a reflection to get you to share what is your personal philosophy of nursing?
Should parents lie to kids about santa claus : Write a diagnostic about the first topic "Should parents lie to kids about Santa Claus? Please follow the instructions and use reference
Discuss the possible nursing interventions : Discuss the possible nursing interventions to accommodate Fatima's religious practice. Please explain why you use the interventions.
Explain the interpretation of political cartoon : What other techniques could the cartoonist have used to make this cartoon more persuasive?What issue is this political cartoon about?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd