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 fuunction that computes future investment value

Write a fuunction that computes future investment value at a given interest rate for a specified number of years.

  Show time in tmu and seconds

An associate grasps an oven door within reach and pulls it open 18 inches with the left hand (he does not relinquish control of the door).

  Display the union of square and cube sets

Determine the union, intersection and difference of the square and cube of integers ranging from 1 to 100. Sets are clearly the way to go here.

  CITS1401 Computational Thinking with Python Assignment

CITS1401 Computational Thinking with Python Assignment help and solution, Assessment help - University of Western Australia - Construct a Python program

  Write a program to simulate the grocery store

You have been asked to write a program to simulate the grocery store as it checks out customers. YOU ARE REQURED TO USE A QUEUE TO SOLVE THE PROBLEM.

  Write a program that lets the user play the rock and paper

Write a program that lets the user play the rock, paper, scissor game against the computer. The computer should work as follows The program should have.

  Craete a program that simulates a traffic light

Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green.

  Provide an example of an array

Lists and arrays can be valuable tools for the programmer. Provide an example of a ‘list' and explain how it would be used as part of a problem solution.

  Simulate a tally counter that can be used to admit a limited

Simulate a tally counter that can be used to admit a limited number of people. First, the limit is set with a call def setlimit self, maximum.

  Display the total amount for each service category

The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event.

  Write a function that takes as input an image object

Write a function that takes as input an image object, crops it to make it a square, and returns the resulting object. You must write a function to accomplish this.

  Determine how many students scored above the average

He wants to average the grades for his last exam in his medieval literature course and then determine how many students scored above the average and how many scored below.

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