Load catalogue from file, C/C++ Programming

Assignment Help:

Implement a menu driven real estate catalogue system that allows users to perform various catalogue maintenance and search tasks.  You are only allowed to use the C programming language.  You are not allowed to use C++.

Please use the "AssignTemplate.c" file found inside the Assignment Folder of LMS as the basis for your solution.  If you follow that template you will not go far wrong.

Please do not use global variables.  Up to 50% of marks will be lost for assignments that use global variables.

Please do functional decomposition.  Up to 50% of marks will be lost for students who try to write the entire program in one main function or something similar.  There should be at least 5 functions for the assignment.  One function for each task 2 to 4.  Two functions for task 5.  More functions than 5 is highly recommended.  The aim of this rule is to teach you how to pass pointer arguments into functions.

Task 1

The program should be menu driven.  The user should be presented with the following menu:

1. Load catalogue from file

2. Save catalogue to file

3. Display catalogue

4. Search property from catalogue

5. Quit

After selecting one of the above options the corresponding task should be performed.  After completing the selected task, the menu should be displayed again for the user to choose again unless the 5th option is chosen.

Task

Implement the load catalogue from file menu option.  After selecting this option the user should be asked to enter the name of a file to be loaded.  The file should then be loaded into an array of structures.  The array of structures should have been declared in the main function before the load catalogue function was called.  To get full marks for this task you should use run-time (dynamically) allocated memory for the array of structuresIf you use static memory allocation you will lose 5 marks.   You can assume the file will have the following format (note you can find an example input file inside the assignment folder called "example_input.txt", make sure your program at least works with that file).

[Number of properties]

[Address of property]

[Real estate agent firstname], [Real estate agent surname]

[Number of bedrooms]

[Price of property]

...

...

[Address of property]

[Real estate agent firstname], [Real estate agent surname]

[Number of bedrooms]

[Price of property]

The ... stands for intermediate catalogue entries. 

You can assume the property address string to be a maximum of 200 characters.

The firstname and surname strings have a maximum of 100 characters each.

Here is an explanation of the above fields:

 

[Number of properties]     -    This is the number of properties stored in the file

[Address of property] - A string specifying the address of the property, the string may contain spaces, punctuation, and numbers.  However the entire address is specified in one line.  Hint: you can use fgets to read in a whole line at a time.  Use stdin as the file pointer, since you are taking input from the keyboard.

[Real estate agent first name], [Real estate agent last surname] - Two strings which do not contain spaces but are separated by a comma followed by a space.

[Number of bedrooms]  - A number specifying the number of bedrooms in the property

[Price of property]  - Price of the property, it may contain a decimal point.

Below is an example of a catalogue file that contains 2 properties:

2

32 Bugden Ave, Forest Hill, VIC 3108

Peter, Kernighan

3

602000.82

292 Smith St, Blackburn, ACT 3920

 

2

222292.84

If the sample file is copied from windows XP into putty.  You my need to use the following command to change the format of the file from windows to unix:

dos2unix


Related Discussions:- Load catalogue from file

Define bitwise left shift and right shift operators, Define Bitwise Left Sh...

Define Bitwise Left Shift and Right Shift Operators: >? The bitwise shift operators shift their first operand right (>>) or left ( // Illustration of the bitwise right shi

Boolean functions and simple logic design, The digital signal is one which ...

The digital signal is one which only consists of two states i.e. logic '1'   (+5 volts) and logic '0' (0 volts). Various electronic blocks use logic and these form the basis of a m

Should my constructors employ"assignment"or"initialization, Should my const...

Should my constructors employ "assignment" or "initialization lists"?

Create program to newtons method for cube roots, Newton's method for cube r...

Newton's method for cube roots is based on the fact that if y is an approximation to the cube root of x, then a better approximation is given by the value: (x/y 2 +2y)/3 (a)

HASHING, What is meant by open addressing? Explain various collision resolu...

What is meant by open addressing? Explain various collision resolution techniques with example

Pawnbroker software to be written in vb, Pawnbroker software to be written ...

Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my

What do you meant by linear search, Question : (a) One of the most co...

Question : (a) One of the most common sorting techniques we have in programming is the ‘Bubble Sort'. This technique will be used to sort an array of elements in ascending or

Compiler design-limit the methods, Ask question #Minimum 100Problem : Compi...

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi

Determine the current flowing in the circuit - voltage, Four cells, each wi...

Four cells, each with an internal resistance of 0.40 ? and an e.m.f. of 2.5 V are connected in series to a load of 38.40 ?. (a) Verify the current flowing in the circuit and t

Write Your Message!

Captcha
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