1.It's an online class.
2.I live 2 hours away from the professor's office.
3.I didn't realize I would have such a problem with this class until after the drop date.
4.I'm out of ice cream and it...
Type: Posts; User: rosemary
1.It's an online class.
2.I live 2 hours away from the professor's office.
3.I didn't realize I would have such a problem with this class until after the drop date.
4.I'm out of ice cream and it...
Very good point. But my professor is notorious for NEVER emailing students back. So, I come here.
Matticus-I believe you are correct. I did not understand the question, so I was trying to do something that was not possible. Thank you so much.
whiteflags-Take a deep breath. This is my last...
I'm not sure of anything. That's why I'm here.
I know how to write the code with the function after or before main(). Why I am asking for help is because my assignment asked us to rewrite the code with the swap function INSIDE main-
"Now...
ok. now i'm here. it compiles, but my values for x and y display as 0.
#include <stdio.h>
void swap(int &x, int &y);
int main(void)
{
int first_num = 10;
ok. so i get the error "Id returned 1 exit status." what does that mean? thanks.
#include <stdio.h>
void swap(int &x, int &y);
int main(void)
What does it mean when it reads "invalid type of unary '*' (have 'int') ?
#include <stdio.h>
void swap(int* x, int* y);
int main(void)
This is my beginning code-
#include <stdio.h>
int main(void)
{
void swap(int x, int y);
Could you explain more?
What does this mean to you-
"Now modify your program so that the swapping performed by the function will appear in the main program after calling the function." ?
Sorry, I meant I have another code that works. The one I pasted is the one I was trying to make into a nested function, but obviously it is not possible. Thanks for your input.
I didn't think C allowed nested functions. That's why I was confused. I already have a code that works with the function after main. I will contact the professor and ask for a clarification. ...
Hi all-
Could someone please help me with this assignment? I have a swap code that works, but now I need to alter it so the swap function appears in the main function after I call the function. ...
while (cents > 30)
{
++dQD3.quarters;
cents = cents - 25;
ok. i added the cents variable. thanks laserlight! i know i still don't solve the problem laserlight mentioned about 3 dimes turning into 1 quarter instead of staying 3 dimes (and not losing that 5...
bummer!
thanks for the help everybody :cool:
it says "use 3 simple variables".
but, i think i got it.
i should have been starting with the smallest coin instead.
#include <stdio.h>
struct dollarsQuartersDimes
{
i am trying to change everything to pennies, and then change it back.
my assignment was to use just the 3 variables i have already used.
ok. here's my changed code.
#include <stdio.h>
struct dollarsQuartersDimes
{
int dollars,
quarters,
wouldn't it be impossible to have 21 cents? so, if it's above 20 cents, it has to be 30 cents, right?
can anyone help? thanks.
Like this? But it still does not give me correct change.
#include <stdio.h>
struct dollarsQuartersDimes
{
int dollars,
quarters,