New

Learn smart - Learn online. Upto 88% off on courses for a limited time. View Courses

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

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!

ICT159 Foundations Of Programming

tag 0 Download 2 Pages / 486 Words tag 24-11-2020
  • Course Code: ICT159
  • University: Murdoch University
    icon

    MyAssignmentHelp.com is not sponsored or endorsed by this college or university

  • Country: Australia

Questions:

1.

You should read this question as if the change giver is a bank teller who has to give amounts of money to customers but can’t count very well so needs you program to help them.

You are asked to write a simple C program that will accept an integer value in the range of 5-95 and as a multiple of 5 representing the number of cents to give to a customer in their change. The program should calculate how many coins of each denomination and display this to the user. Valid coin values are 50, 20, 10 and 5. Your solution (program and algorithm) should be modular in nature. This requires the submission of 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 one function in particular 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 which each perform a similar task (or have a lot of repeated code) then attempt to analyse your design to generalise the logic so that it may be reused.

2.

You are to extend your solution to Question 1 above by allowing the user to enter the amount of change as dollars and cents as a double (real number). Valid dollar values are 100, 50, 20, 10, 5, 2 and 1. You program should output the correct combination of dollar and cent denominations required and should be able to work for any valid dollar amounts. Cents amounts may be should be multiples of 5 as in the previous question.

In this question you will need to explicitly convert a double to an integer to break the inputted double down to its component parts as integers. You can use the following code as the basis for doing this:

float change;

int dollar, cents;

...

dollar = (int) change;

cents = (int) (((change – dollar)*100) + 0.5);

Again your solution for this problem should be modular.

Download Sample Now

Earn back the money you have spent on the downloaded sample by uploading a unique assignment/study material/research material you have. After we assess the authenticity of the uploaded content, you will get 100% money back in your wallet within 7 days.

Upload
Unique Document

Document
Under Evaluation

Get Money
into Your Wallet

Total 2 pages

Cite This Work

To export a reference to this article please select a referencing stye below:

My Assignment Help. (2020). Foundations Of Programming. Retrieved from https://myassignmenthelp.com/free-samples/ict159-foundations-of-programming/value-of-n-as-integer.html.

My Assignment Help (2020) Foundations Of Programming [Online]. Available from: https://myassignmenthelp.com/free-samples/ict159-foundations-of-programming/value-of-n-as-integer.html
[Accessed 15 August 2022].

My Assignment Help. 'Foundations Of Programming' (My Assignment Help, 2020) <https://myassignmenthelp.com/free-samples/ict159-foundations-of-programming/value-of-n-as-integer.html> accessed 15 August 2022.

My Assignment Help. Foundations Of Programming [Internet]. My Assignment Help. 2020 [cited 15 August 2022]. Available from: https://myassignmenthelp.com/free-samples/ict159-foundations-of-programming/value-of-n-as-integer.html.


We Can Help!

Get top notch assistance from our best tutors !
Excel in your academics & career in one easy click!

icon

Other Samples

Content Removal Request

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

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?