Recent content by odinx
-
O
How do you give an error for someone entering a letter
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; double sort(double input[], int N) { double temp; int i, j; for (i=0; i<=8; i++) { for (j=i+1; j<=9; j++) { if(input[i]>input[j]) { temp=input[i]...- odinx
- Thread
- Error
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
O
C/C++ How to make my program switch commands at certain intervals/bounds in c++
They aren't int values- odinx
- Post #3
- Forum: Programming and Computer Science
-
O
C/C++ How to make my program switch commands at certain intervals/bounds in c++
I have a new problem where I have 2 formulas, and I need to tell my program that at certain intervals/parameters/bounds it needs to do one of the formulas and at other intervals it needs to do another one. To be more descriptive When ever my time=0 to time=(T/2) it should do formula 1, and...- odinx
- Thread
- C++ Program Switch
- Replies: 3
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double a,b,c,h,v,w,x,y,z,tolerance,series,series1; tolerance=0.01; cout << "Enter the width, W: "; cin >> w; if (w<0) { cout << "Error: The Width must be...- odinx
- Post #11
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double a,b,c,h,v,w,x,y,z,tolerance,series,series1; tolerance=0.01; cout << "Enter the width, W: "; cin >> w; if (w<0) { cout << "Error: The Width must be...- odinx
- Post #10
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
I think I got what you meant. The program works, but the precision and accuracy is still off and I don't know why. Can anyone see where I go wrong? #include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double...- odinx
- Post #7
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
could you please clarify a bit more I'm still kinda lost. Also I feel as if the program is working, but it isn't checking my tolerance value of 0.01/ making sure that the difference of a and be is not more then 0.01 of each other. Because when I run the program I get values, but they're off...- odinx
- Post #5
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
I think I got it, but I'm not sure... The only problems I can see is if the compiler get's confused with what is what for my while and if statements. I also set the functions bounds to be constant. #include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using...- odinx
- Post #3
- Forum: Programming and Computer Science
-
O
C/C++ How to Solve Bisection C++ Problem for Calculating Volume
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double h,v,w,z,y; cout << "Enter the width, W: "; cin >> w; if (w<0) { cout << "Error: The Width must be strictly positive." << endl; return EXIT_FAILURE; }...- odinx
- Thread
- C++
- Replies: 10
- Forum: Programming and Computer Science