Is what i've written even remotely close to what I need it to do?
Write a C++ programthat will do the following:
1. Read data from the keyboard in the form
vitamin price quantity
2. Call a...
Type: Posts; User: iGuardian
Is what i've written even remotely close to what I need it to do?
Write a C++ programthat will do the following:
1. Read data from the keyboard in the form
vitamin price quantity
2. Call a...
For some reason when I run the program I output hexidecimals. Can anyone help me with this and point me in the right direction?
#include <iostream>#include <cstdlib>
#include <fstream>
#include...
I don't quite understand where I am messing up in this program. It is outputting 1 and I can't figure out why. Can anyone point me in the right direction?
#include <fstream>
#include...
I have been working on this for a few days now and I still can't wrap my head around arrays and filling in arrays to compute the Standard Deviation of an input file.
This is what I have:
...
I am having a hard time understanding how to establish arrays for this problem. We're supposed to write a program that reads in numbers from 2 different files, and it averages one of the files while...
Ok, That makes sense, I was once again making it harder than it should have been. When dealing with files do you suggest I only declare one variable rather than declaring many as I did before.
In this program I have to write a program that has to take the inputs of a file and output the average of the sum of numbers. My question is regarding how to average the numbers by adding the total...
I assume I made the same mistake as before. Is this in the right direction?
#include <iostream>
using namespace std;
int fib ( int n );
// Function reference.
I'm following along the tutorial while i attempt to do it. Is this correct so far provided what you showed me
#include <iostream>
using namespace std;
// Recursion will be used for this...
I apologize, I'm only 8 weeks into the course so I may come off more dumb than I really am, C++ isn't coming to me as easy as i thought
So after looking at some recursion tuts, can this be used for recursion, as dumb of a question as it may be.
so in this case, the function would look like
int fib ( int n ){
int fib = 0;
int fib1 = 0;
int fib2 = 1;
fib = fib1 + fib2;
fib1 = fib2;
I realize it has to do with
but my question is how would I go about setting it to add all numbers that can be modded by 3 and or 5 that are less then 4 million.
Not yet, we are getting to it in 2 chapters
It compiles properly but when I run the program it is a blank screen. Is it because i do not call int fib( int n )?
"Edit"
I realize it's timing out now, I just do not understand why.
#include...
The reason why I use that is so i don't get an output of say, 3:60 AM
My question for this is regarding a time computation error I am having. Rather than outputting AM or PM, regardless of what I input, I get AM. Is it the if/ else statement or should I use a for...
#include <iostream>
using namespace std;
void get_input ( double &inches, double &feet );
void give_output( double centimeters, double meters );
int main ()
{
Question regarding the response issue. I am having the user input 1 in order to calculate for meters/centimeters and 2 for inches and feet. It has to be an if/else statement, but whenever I run it,...
Thanks for the feedback!
Ok, this is my new code. Any suggestions?
#include <iostream>#include <cmath>
using namespace std;
double basal_rate ( int weight_par, int calories );
Ok, My question for this one is a bit more complicated. What I am trying to do is to get the program to first calculate the Basal Metabolic Rate, then the amount of calories needed to maintain the...
If I were to change "int" to say float or double, would that make it better. The while loop is to prompt a response, y-yes, i fixed the upper/lower case.
The file compiles correct, I just want to make sure i assigned the function and variables correctly because when i run the program, the output is always 0 reguardless of the inputted numbers.
...
Thank you very much for your time and patience, I'll start working on it more.