*bangs head on desk*
You have no idea how many hours I've paged through the same three chapters in my book trying to figure this out. Thanks a TON for all the help!
Type: Posts; User: JJohnson
*bangs head on desk*
You have no idea how many hours I've paged through the same three chapters in my book trying to figure this out. Thanks a TON for all the help!
Commenting that out of the DollarsToYen function correctly displays the Yen amount, but for only one deposit. Every deposit after is still listed as 0.
Thank you for your help. I get the correct dollar amount displayed back out of the array, but the Yen values appear to be arbitrary. For example, if I enter 2 Deposits, both at 1 Dollar and 1...
//gives number of Yen in each account
void DollarsToYen ( float Dollars[], float Yen[], int count )
{
int j;
for ( j = 0; j < count; j++ );
Yen[j]=Dollars[j]*DOLLARS_TO_YEN;
}
*slaps forehead*
That was not my only problem fortunately. I'm not getting values to display still.
// Evaluate Yen
#include <iostream>
#include <iomanip>
Hmm I have another version setup with setw, but when I try to compile dev gives me an "outdated header" error with the iomanip?
I am trying to build a program that inputs deposits into an array by dollar amount, and displays them back in both dollars and Yen. I successfully built the program in C, but for some reason I can't...
Are you saying define int p,n,d,q in the public functions? I'm a little confused....
Thank you for the fast responses. I'm sorry I was trying to 0 out the values because I was getting such weird output, I understand it is illegal. I will edit my first post rather than reposting the...
I am attempting to create a class and subsequent functions simulating a purse.
Here are my instructions :
-Declare Purse Class
-Include 4 private data members
+int pennies, int nickels, int...
Thanks, makes a lot more sense in English than confusingly staring at code. I think I'm close.
#include <stdio.h> /* printf, scanf definitions */
#include<string.h> ...
So according to what you gave me, I need to declare 13 variables in my main just to pass values through a function? Doesn't make much sense to me. Or pass non-existing variables to the function?
...
Well I have a function now, but unable to call the structures from within the function, which is what I was afraid of happening.
I get "d1 undeclared"
/* Calc Function */
void calc()
{
linches = ((((d1.length.yards*3)+(d1.length.feet))*12) + d1.length.inches);
winches = ((((d1.width.yards*3) + (d1.width.feet)) *12) + d1.width.inches);
Would like to use functions...
Nope but I guess you learn something new everyday.
linches = (((d1.length.yards*3)*12) + (d1.length.feet *12) + d1.length.inches);
winches = (((d1.width.yards*3)*12) +...
I'm attempting to design a structure within a structure.
My directions are :
Declare a second structure area which has two structure variables yardsfeetinches length and yardsfeetinches...
I have it working (so far) after setting each value to 0 before main(). I am now working on the if statement to calculate the number of dollars of multiple inputted quarters and dimes. What would...
I think I'm getting closer....however, if I try to insert the following "2 3 4" into my following code, it prints the following, "You currently have 4140946 Dollars, 41232475 Quarters, and 2686780...
#include <stdio.h>
typedef struct {
int dollars;
int quarters;
int dimes;
} dollarsQuartersDimes;
Thanks for the help so far and the forums have been very helpful so far. I have browsed through other people's issue's for help and regret not registering earlier.
#include <stdio.h>
...
After changing "a" to "dollarsQuartersDimes a;" I received the following error :
21 invalid types `int[int]' for array subscript
I'm having trouble setting up a structure. My instructions are
"Define the structure dollarsQuartersDimes
with three simple variables int dollars, int quarters and int dimes
to declare...