Securing Higher Grades Costing Your Pocket? Book Your Assignment at The Lowest Price Now!
loader

Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Add File

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!

Stuck on Your Question?

Get 24x7 live help from our Top Tutors. All subjects covered.

Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

loader
250 words

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Students Who Viewed This Also Studied

0 Page
The Range of Feature Values

...

Course

FIT9133

Subject

Programing

University

Monash University

Season

Spring

0 Page
Interactive Practice of Python

...

Course

FIT9133

Subject

Programing

University

Monash University

Season

Spring

0 Page
Data Engineer Role in a Company

...

Course

FIT9133

Subject

Programing

University

Monash University

Season

Spring

15 Pages
ICT707 Data Science Practice

Question: Part I - PySpark source code Important Note: For code reproduction, your code must be self-contained. That is, it should not require other libraries besides PySpark environment we ...

Course

ICT707

Type

Programming

Subject

Programing

University

University of the Sunshine Coast

ICT159 Foundations of Programming

Question

Answered

Question:

Objectives:

  • Construct algorithms to solve problems using a combination of sequence, selection and iteration constructs.
  • Implement such algorithms in a common programming language, C.
  • Read/write data to/from files.
  • Use arrays of records (structs).
  • Search arrays of records.
  • Apply the methodology of top-down design to the construction of solutions and implement these solutions in a modular way.

Task:

There is meant to be code reuse from assignment 1 if your design and code from assignment 1 adheres to the principles of high cohesion and low coupling.

You will know if these principles were adhered to if you are able to reuse most of the modules from assignment 1.

Assignment 2 uses structured design implemented in C. Array of records (structs) with file I/O is needed.

The program takes two inputs at a time. The name of a person, and, the coin value as an integer in the range 5 to 95. Input coin values should always be divisible by 5 (integer division). Names are one word strings. An example input is:

Jane 30

This input line indicates that 30 cents change is to be given to Jane.

Output change values need to be in multiples of 50, 20, 10 and 5 cents. The program should aim to give as much of the higher valued coins as possible. A poor solution for an input of 30 cents is to give six 5 cent coins. A better solution is to give a 20 cent coin and a 10 cent coin.

Input to the program comes from a data file called coins.txt. There can be 0 and up to 10 input lines like the example above. It is also possible to have the same name repeated in the data file but the coin values can be different. When the name is the same, it would mean the same individual. If the name is the same, your program would need to add up the coin amounts to obtain a total amount for that individual before computing the change to be given.

Once your program has read in the data from coins.txt, your program will close coins.txt first, and then show a console screen menu as illustrated below. The program will continue to show the menu and execute the menu options until "Exit" is selected by entering the value 2 at the menu prompt.

1. Enter name
2. Exit

When the user enters the value 1 at the menu prompt, your program will ask for a name. As an example, if the user enters the name Jane, the program will output:

Customer:
Jane 30 cents

Change:
20 cents: 1
10 cents: 1 

Change values of 0 are not shown.

If the user enters a non-existent name (e.g. Donald) at menu option 1, and therefore would not be in the array of records, your program will print:

Name: Donald

Not found

After the process output for menu option 1, the menu is redisplayed.
If the user enters 2 to exit, your program will write the coin and change data in CSV format to file called change.csv. After writing the data to the file your program will exit. In change.csv, the data line for Jane will look like the following, with each value separated by a comma and the line is terminated by newline:

Jane,30,0,1,1,0

Each data line in change.csv will be in the format:
name of person,total coin value,number of 50 cent coins, number of 20 cent coins,number of 10 cent coins,number of 5 cent coins newline.

So in the example output, Jane has 30 cents in one 20 cent coin and one 10 cent coin. There are no 50 or 5 cent coins.

The output data file change.csv cannot have repeated names.

You need to provide a test plan to fully test your algorithm and program, and provide an input data file, coins.txt, that contains test data in the specified format for testing your program.

Your solution (program and algorithm) should be modular in nature. Use a high cohesion and low coupling design. Your solution (program and algorithm) should be modular in nature.

This requires the submission of a structure chart and a high-level algorithm and suitable decompositions of each step.

Note that for this problem, the principle of code reuse is particularly important and a significant number of marks are allocated to this.  You should attempt to design your solution such that it consists of a relatively small number of functions that are as general in design as possible and you should have functions/subroutines that can be reused (called repeatedly) in order to solve the majority of the problem.  If you find that you have developed a large number of functions (code modules/subroutines) where each perform a similar task (or have a lot of code that is repeated in the functions) then attempt to analyse your design to generalise the logic so that you have just one general version of the function (module).

Be mindful of the cohesion exhibited by the function (module). So if you have a function (module) that is doing more than one task, then cohesion is low, and, you will need to redesign to have high cohesion.

Assignment Sections:

Your assignment must contain the following components either in the documentation or as separate electronic files, where indicated:

  1. All assumptions made other than those stated in the question that you make about the problem. There will virtually always be assumptions you are implicitly making so think about this very carefully. Also be careful that you do not put in unnecessary assumptions.

  2. Structure chart for your program. Show parameter passing.

  3. Your algorithm written in a uniform fashion using a pseudocode or a similar style and adhering to the conventions required in the unit. Your algorithm should be presented at an appropriate level of detail sufficient to be easily implemented. Submit your high- level algorithm (where necessary) along with algorithms of your decompositions (i.e., low level algorithm) as appropriate to the question.  

    Algorithms that look like the code was written first and then word processed to look like an algorithm would receive no marks.

  4. A set of test data in tabular form with expected results and desk check results from your algorithm. Each test data must be justified – reason for selecting that data. No marks will be awarded unless justification for each test data is provided.

  5. Source code files (.c, .cpp, and/or .h) must be submitted and the source code must build (compile and link) to create an executable that operates correctly. Make sure you use the code style required in the unit. No marks awarded if the source code does not build and run. 

  6. Results of applying your test data to your final program (tabular form), including a sample printout of your program in operation.

  7. Self-assessment of how successful you were in achieving the requirements and a discussion of any problems you encountered. This write up is done in this document template. You need to also submit a separate file evaluation.txt. This file will have, in point form, a summary of what works and what does not work in your program. A false claim here would mean that marks for this component would not be awarded. So make sure that you have tested your program thoroughly. The file evaluation.txt will also declare if you have checked each submitted file for viruses or malware. Name the tool and version number of the tool that you used to conduct the check. If the checks for viruses/malware are not made and the declaration is not shown in evaluation.txt, this assignment will not be marked and no marks will be given to you. Any delay that results from virus or malware will incur the specified daily penalty for the assignment.

ICT159 Foundations of Programming

Answer in Detail

Solved by qualified expert

Get Access to This Answer

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

34 More Pages to Come in This Document. Get access to the complete answer.

More ICT159 ICT159 Foundations of Programming: Questions & Answers

Q
icon

We aren't endorsed by this University

The Range of Feature Values

...

View Answer
Q
icon

We aren't endorsed by this University

Interactive Practice of Python

...

View Answer
Q
icon

We aren't endorsed by this University

Data Engineer Role in a Company

...

View Answer
Q
icon

We aren't endorsed by this University

ICT707 Data Science Practice

Question: Part I - PySpark source code Important Note: For code reproduction, your code must be self-contained. That is, it should not require other libraries besides PySpark environment we have used in the semester. The data files are packaged properly with your code file. In this compo ...

View Answer

Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.io then please raise the content removal request.

Choose Our Best Expert to Help You

icon

5% Cashback

On APP - grab it while it lasts!

Download app now (or) Scan the QR code

*Offer eligible for first 3 orders ordered through app!

screener
ribbon
callback request mobile
Have any Query?
close
Subtraction Payment required!

Only one step away from your solution of order no.