Recent content by burton95
-
B
Comp Sci C++ Error in function call that I don't understand
Thanks Anchovy. The increments i and if loop continues running until you drop out of the for loop or a[i] > a[i+1]. I got my original code to work correctly, I used braces for the body of the if loop, but got all out of wack/confused when I tried his code.- burton95
- Post #14
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
Thank you AlephZero and jbunn. Ok, not to sound defensive but the body of function was cut and pasted from the answer in the book. I actually had different code and was trying to understand why they used the code they did. The question directly from the book: Write a fxn named out of order...- burton95
- Post #12
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
I must admit I don't understand why the book answer has in the for loop i < size - 1 rather that just size. If I have an array of five spaces I need the loop to execute i 0 through 4. a[0] = 2 a[1] = 7 a[2] = 9 a[3] = 8 a[4] = 12 1st loop Step 1: i = 0 so Step 2: check that i < size(5) - 1...- burton95
- Post #9
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
#include <iostream> using namespace std; int out_of_order(int a[], int size); const int amount_of_numbers = 5; int main() { int numbers; int a[] = { 2, 7, 9, 8, 12 }; int number_out_of_order = out_of_order(a, amount_of_numbers); cout << number_out_of_order; } int...- burton95
- Post #7
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
Whoops. If a mod needs to move this to HW CS section I apolgize- burton95
- Post #4
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
Thanks. amount_of_numbers = 5 at the top. Problem: As my current array is arranged 7 > 6 and therefore 6 should be shown on the screen but I keep getting -1. My original idea was to build this as the answer in the book was given for (int i = 0; i < size - 1; i++) if (a[i] > a[i + 1])...- burton95
- Post #3
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci C++ Error in function call that I don't understand
Hi there- I'm trying to check an array for ascending order and if not to print out the number that is out of order by using a function. I solved it by not using a function but when I've tried to use a fxn for some reason it tells me that in my call for the fxn the numbers "argument of type int...- burton95
- Thread
- C++ Error Function
- Replies: 13
- Forum: Engineering and Comp Sci Homework Help
-
B
C/C++ C++; How to read-in a unknown amount of numbers from an external file
Hey thanks. I got it with your help. Sorry it took so long to get back to you.- burton95
- Post #5
- Forum: Programming and Computer Science
-
B
C/C++ C++; How to read-in a unknown amount of numbers from an external file
Basically I want to take an unknown amount of variables and sum them up. I'm sure it's simple. I know there is some way to tell VS to keep reading the opened stream from my numbers.txt file. #include <iostream> #include <fstream> using namespace std; ifstream data_input...- burton95
- Thread
- File Numbers
- Replies: 4
- Forum: Programming and Computer Science
-
B
C/C++ C++. Celsius to Fahren. conver; What temp R they = ?
The return value is correct, -40. I have a feeling getting loops to run the correct amount of times is going to be tricky topic for me for a while. Thanks to both of you.- burton95
- Post #9
- Forum: Programming and Computer Science
-
B
C/C++ C++. Celsius to Fahren. conver; What temp R they = ?
Thanks DH. It says to use int's so that is what I'm doing. Seems pretty obvious now.- burton95
- Post #6
- Forum: Programming and Computer Science
-
B
C/C++ C++. Celsius to Fahren. conver; What temp R they = ?
Oh and berkman asked if I could add code tags. Its he referencing code tags in the body of the post or as a tag for the post?- burton95
- Post #4
- Forum: Programming and Computer Science
-
B
C/C++ C++. Celsius to Fahren. conver; What temp R they = ?
thanks cpscdave, I added your print line code and obviously it doesn't stop @ -40. I don't get it. c_temp: -34 vs f_temp: -29 c_temp: -35 vs f_temp: -31 c_temp: -36 vs f_temp: -32 c_temp: -37 vs f_temp: -34 c_temp: -38 vs f_temp: -36 c_temp: -39 vs f_temp: -38 c_temp: -40 vs f_temp: -40...- burton95
- Post #3
- Forum: Programming and Computer Science
-
B
C/C++ C++. Celsius to Fahren. conver; What temp R they = ?
I must write a program that finds the temperature, as an integer, that is the same in both Celsius and Fahrenheit. The formula for this is F=(9/5)C+32 The program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degrees...- burton95
- Thread
- celsius
- Replies: 18
- Forum: Programming and Computer Science
-
B
What is the speed of the m1 piece after the explosion?
Nevermind i got it. I was setting up v2 for the wrong equation. Thx- burton95
- Post #5
- Forum: Introductory Physics Homework Help