No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Believe in love that lasts forever!Forgive,love and thank God for every moment and for the least that you have!Don't take anything for granted!
> Not sure why do I always get a 0 from the isvalidReal function? int isvalidReal(string signedNum) { bool check; int i = 0, j = 1; string str = "+-."; for (i = 0; i <= signedNum.length(); i++) { if (isdigit(signedNum[i])) { check = 1; } else if (signedNum[0] … |
|
> The following letters are stored in an alphabet array: B, J, K, M, S, and Z. > Write and test a function named adlet(), which accepts the alphabet array and a new letter >as arguments, and then inserts the new letter in the correct alphabetical order in the array. … |
|
int game() { int n; cout << "enter an odd number: "; cin >> n; int MagicSquare[n][n]; // It says that the expression must have a constant type? int newRow,newCol; int i = 0; int j = n / 2; for (int i = 0; i < n; i++) { … |
|
> This compiles but does not show me any results? Why #include <iostream> #include <cmath> using namespace std; void dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 … |
|
void init1() { static int yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = yrs + 2; return; } void init2() { static int yrs; yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = … |
|
#include <iostream> #include <cmath> using namespace std; double dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); cout << " … |
|
> Write a C++ function named fracpart() that returns the fractional part of > any number passed to it. For example, if the number 256.879 is passed to fracpart(), the > number 0.879 should be returned. Have fracpart() call the whole() function you wrote in > Exercise 12. The number … |
|
> *no instance of function template*maximum* matches the argument list argument types are: (int,int,int)* #include <iostream> using namespace std; template <class T> T maximum(T value) { T maxValue; if (value >= maxValue) maxValue = value; else value = value; return value; } int main() { int number1 = 1; int … |