Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================
- // Name: Sifat Dipta
- // Student Number: IDK
- // Email: sdipta@myseneca.ca
- // Section: XXX
- // Workshop: 2 (in-lab)
- //==============================================
- #define _CRT_SECURE_NO_WARNINGS
- // Start your code below:
- #include <stdio.h>
- int main(void) {
- printf("Please enter the amount to be paid: $");
- double ammountPaid;
- scanf("%lf", &ammountPaid);
- //printf("%lf\n", ammountPaid); // Test User Input
- double rLoonies = ammountPaid / 1;
- int a = rLoonies;
- double balanceOwe = rLoonies - a; //0.68
- printf("Loonies required: %d, balance owing %0.2lf\n", a, balanceOwe);
- double rQuarters = balanceOwe / 0.25;
- int b = rQuarters;
- double quarterEquals = b * 0.25;
- double leftOver = rQuarters - quarterEquals;
- printf("Quarters required: %d, balance owing %0.2lf\n", b, leftOver);
- /*------------------------------------------
- double rQuarters = rLoonies / 25;
- //b = a - ammountPaid;
- printf("Loonies required: %d\n", a);
- printf("%.0lf\n", rQuarters);
- //printf("%d", b);*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement