Question
Programming language - objective C For some reason I can't figure it out and I'm getting unresolved external symbol errors #define _CRT_SECURE_NO_WARNINGS #include #include void
Programming language - objective C
For some reason I can't figure it out and I'm getting unresolved external symbol errors
#define _CRT_SECURE_NO_WARNINGS #include
void getPaid(float* paid, float* due);
//Definition of makeChange void makechange(double due, double paid, double* S, int* dollar, int* qtr, int* dime, int* nkl, int* pen) { int t; t = (paid - due) * 100; *S = paid - due; *dollar = t / 100; t = t % 100; *qtr = t / 25; t = t % 25; *dime = t / 10; t = t % 10; *nkl = t / 5; t = t % 5; *pen = t / 1; t = t % 1; return *dollar / 100;
} void printResults(float paid, float due, int dollar, int qtr, int dime, int nkl, int pen);
int main() { //Time to make change! int dollar = 0, qtr = 0, dime = 0, nkl = 0, pen = 0; double paid = 0.0, due = 0.0; double S;
// How much has been charged printf("How much was the total?$ "); scanf_s("%lf", &due);
if (paid
getPaid(&paid, &due);
printf("Please wait, calculating the change. "); printf("Please wait, calculating the change. 3 "); printf("Please wait, calculating the change. 2 "); printf("Please wait, calculating the change. 1 "); printf("Please wait, calculating the change. POOF! ");
makeChange(paid - due); makeChange(paid, due, &dollar, &qtr, &dime, &nkl, &pen);
printResults(paid, due, dollar, qtr, dime, nkl, pen);
printf("Your total change is $%p", &printResults); if (dollar != 0) printf("%2d dollar(s)", dollar); if (qtr != 0) printf("%2d quarter(s)", qtr); if (dime != 0) printf("%2d dime(s)", dime); if (nkl != 0) printf("%2d nickle(s)", nkl); if (pen != 0) printf("%2d pennie(s)", pen); printf("That's %d dollars, %d quarters, %d dimes, %d nickles, and %d pennies", dollar, qtr, dime, nkl, pen);
return 0; }
^ here is the text
1. Write a program to dispense change. The user enters the amount paid and the amount due. The program determines how many dollars, quarters, dimes, nickels, and pennies should be given as change. Modular programming, pass by value, pass by reference, function definitions and main listed below must be used. Function Specifications getPaid Precondition-paid and due are initialized to zero. Postcondition - paid is greater than due, paid is less than 20 dollars. makeChange Precondition - paid is greater than due, paid is less than 20 dollars. Postcondition - dollar, qtr, dime, mkl, pen are output parameters and with the correct values based on the change calculation. Input parameters are paid and due, therefore will not change. printResults Precondition - all input parameters will be accurate Postcondition - results printed void getPaid(float *paid, float *due); void makeChange(float paid, float due, int * dollar, int *qtr, int * dime, int *nkl, int *pen); void printResults(float paid, float due, int dollar, int qtr, int dime, int nkl, int pen); void main() { int dollar = 0, qtr = 0, dime = 0, nkl = 0, pen = 0; float paid = 0.0, due = 0.0; getPaid(&paid, &due); makeChange(paid, due, &dollar, &qtr, &dime, &nkl, &pen); printResults(paid, due, dollar, qtr, dime, nkl, pen); } #define _CRT_SECURE_NO_WARNINGS #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started