0% found this document useful (0 votes)
49 views4 pages

Programming Fundamentals Project: Faculty of Information Technology UCP Lahore Pakistan

The document describes a programming project that involves analyzing pesticide test score data stored in a table with multiple fields and locations. The user is prompted with a menu to perform various tasks on the data including: inserting a new score, counting total scores, deleting a score, displaying the most frequent scores, calculating average scores per field, and identifying the field with the highest scores. Sample expected outputs showing the results of selecting each menu option are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views4 pages

Programming Fundamentals Project: Faculty of Information Technology UCP Lahore Pakistan

The document describes a programming project that involves analyzing pesticide test score data stored in a table with multiple fields and locations. The user is prompted with a menu to perform various tasks on the data including: inserting a new score, counting total scores, deleting a score, displaying the most frequent scores, calculating average scores per field, and identifying the field with the highest scores. Sample expected outputs showing the results of selecting each menu option are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Programming Fundamentals

Project

Faculty of Information Technology


UCP Lahore Pakistan
Due Time: 2 July 2021, 11:00 PM Total Marks: 40

Note:
 This is an individual Project.
 100 % marks will be given on the basis of No Memory leakage, No dangling pointers, and No
extra space should be wasted. Also make use of helper functions where ever required.
 String data type not allowed instead use CString with null termination else you will get 0.
 File Handling is must
 Submission will be on portal in Lab under folder named Project_Submissions.

Project 1: “Pestcouts” is an emerging pesticide (insect killer) research lab. They are aiming at producing
environmental friendly pesticides. Currently they are conducting tests for a new formula on a farmhouse.
They divided the farmhouse into 4 fields. They have conducted a test and record the success scores.
Scores are sent to the system one by one and stored in a table as shown below.

In the below data table, tests are being conducted in 4 fields. Each field corresponds to row and each test
value corresponds to column of data.

Field 1 5 1 21 -1 -1 -1

Field 2 -1 -1 -1 -1 -1 -1

Field 3 23 5 20 5 30 -1

Field 4 1 9 5 0 -1 -1

Note: -1 shows that field is empty.

1. Insert a new value in any field of table at first empty location.


2. Count the number of filled locations (values other than -1) in whole table
3. Delete any filled value from any field. (Deletion means replace with -1)
4. Find and display the top two values in whole data (excluding -1) which have maximum occurrences.
For example, in given data table above, 5 has maximum occurrence of 4 times while 1 has second
maximum occurrence of 2 times.
5. Calculate Average test score of all the field values (excluding empty locations).
6. Tell the field/s no having maximum success scores value

Expected Output 1:
 Press 1 to insert new test result.
 Press 2 to display total number of results in table.
 Press 3 to delete any test value from table.
 Press 4 to display the 2 most frequent values in table.
 Press 5 to display average scores of each field.
 Press 6 to display field having maximum success score.

 Enter choice: 5
Field1 average: 9
Field2 average: empty field
Field3 average: 16.6
Field4 average: 2.5

Expected Output 2:

 Press 1 to insert new test result.


 Press 2 to display total number of results in table.
 Press 3 to delete any test value from table.
 Press 4 to display the 2 most frequent values in table.
 Press 5 to display average scores of each field.
 Press 6 to display field having maximum success score.

 Enter choice: 6
Field3 has the maximum success score.

Expected Output 3:

 Press 1 to insert new test result.


 Press 2 to display total number of results in table.
 Press 3 to delete any test value from table.
 Press 4 to display the 2 most frequent values in table.
 Press 5 to display average scores of each field.
 Press 6 to display field having maximum success score.

 Enter choice: 2
There are 12 test score values entered in table.

Expected Output 4:
 Press 1 to insert new test result.
 Press 2 to display total number of results in table.
 Press 3 to delete any test value from table.
 Press 4 to display the 2 most frequent values in table.
 Press 5 to display average scores of each field.
 Press 6 to display field having maximum success score.

 Enter choice: 1
Enter the field in which you want to enter a value: 1
Enter the value you want to enter: 12

12 is entered in field 1 at location 4

Field 1 5 1 21 12 -1 -1

Field 2 -1 -1 -1 -1 -1 -1

Field 3 23 5 20 5 30 -1

Field 4 1 9 5 0 -1 -1

You might also like