- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Hi guys, need some help with this. I googl'ed but found no solution. :icon_sad: [CODE=cpp] #include <iostream> #include <ctime> #include <cstdlib> using namespace std; void createRationalNo (int, int); int RationalInfo (int []); //void printArray (int [], int); const int MAX = 20; const int setArray = 5; int initialArray [setArray][MAX]; … |
|
[CODE=cpp] while (j < i) { cin.ignore(); cout << "Please type enter to display: "; cin >> enter2; if (strcmp(enter, enter2) == 0) { cout << "ID: " << students[j].ID << endl; cout << "Name: " <<students[j].name << endl; cout << "Address: " <<students[j].address << endl; cout << "Telephone: " … |
|
Re:
Anyone know how to accomplish this task on visual studio with C++? Write a program that reads a series of numbers (doubles) from the user, then prints the mean and the range. Notes: • You do not know ahead of time how many numbers will be in the list. • … |
|
Hi guys, I'm having some problem with my C++ assignment. Can't get this part down. [CODE=CPP] class Date { private: static const int daysInMonth[13]; int monthNo, year, day; string month; bool validDate, leapYear; public: void displayDaysInMonth(); void displayDate(); void enterDate(); void verifyDate(); void displayOptions(); void ahqError() {cout << "Error! Enter … |
|
Re:
so i have spent 3 hours trying to figure out how exponents work in C++ but now. my if statement isnt working. even if i punch in a 0 it spits out 1 thanks in advance [CODE]#include<iostream> #include<string> #include<cmath> using namespace std; void binToDec(string getBinary); void main() { string getBinary; … |
|
[url]http://i126.photobucket.com/albums/p98/justln/untitled3.jpg[/url] Which codes do I use so that the answer is not out of place? I tried using \t and setw but it doesn't work :( |
|
Hi, I'm doing a project regarding converting roman numerals to decimals and vice versa. With some reference from the internet, I was able to come up with one. However, it isn't working very well. Can someone look at my codes and point out what/where's the mistakes? Thanks in advance. [CODE=cpp] … |
|
I'm almost done with my assignment but now I'm stuck with some binary file problems. Below is the binary file section of my work. [CODE=cpp]cin.ignore(); cout << "\nPlease enter filename: "; cin >> openBinary; ifstream finBinary; finBinary.open(openBinary, ios::in | ios::binary); if (!finBinary.good()) cerr << "File could not be opened" << … |
|
Re:
this is the program: [code=cplusplus] #include <iostream> using namespace std; int main() { double f0, speed, f1; f0 = 2e-10; speed = 75; f1 = ((speed + 6.685e8) * f0) / (6.685e8 - speed); cout << "The return frequency corresponding to 75 miles per hour is " << f1 << … |
|
Part of the code from the program I'm having trouble with. The deletion of array element for this doesn't work properly. Can anyone tell me why? I can't spot any mistakes though zzz, [CODE=cpp]cin.ignore(); delStudentCounter = 0; cout << "Please enter ID to delete student: "; cin.getline(delStudent, 50); for (int … |
|
[CODE=cpp]void choiceSelect() { int choice; char exitconfirm[100]; printmenu(); cin >> choice; if (isdigit(choice)) { if (choice == 7) { cout << "Exiting program. Enter yes to confirm.\n"; cin.ignore(); cin.getline (exitconfirm, 100, '\n'); if (strcmp ("yes", exitconfirm) == 0) { exit (1); } else { choiceSelect(); } } while (choice != … |
|
[CODE= CPP] //Searching for specific characters while (!stats.eof()) { stats.getline(counter,200); for (int i=0; i<strlen(counter); i++) { if (isupper(counter[i])) upper++; if (islower(counter[i])) lower++; if (isdigit(counter[i])) decimal++; if (isspace(counter[i])) blank++; if (counter[i] == '.') end++; if (counter[i] == '!') end++; if (counter[i] == '?') end++; total++; } } [/CODE] Hi guys, I … |
|
[CODE= cpp] #include <iostream> #include <ctime> #include <cstdlib> #include <iomanip> #include <fstream> using namespace std; const int MAX = 51; const int setArray = 5; float initialArray[MAX][setArray]; void createRationalNo (int, int); float RationalInfo (float[][setArray], int); void printArray (float[][setArray], int); int main() { cout << "No\tP\tQ\tQuo\tRem\tValue\n\n"; srand(time(NULL)); int setPQ = 2; … |
|
Re:
this would be my first time with arrays so i still have no idea how to use it i'm thinking on using it on this program [code=c++]#include <iostream> #include <conio.h> #include <string.h> using namespace std; int main() { char main_menu; char parts; char items[]; //here's the part i don't know … |
|
Hi guys, I need a little help in my assignment. Got it down to the last part but I don't really get recursive functions. [code=language] #include <iostream> #include <ctime> using namespace std; void constructArray (int [], int); void swapArray (int [], int); int printArray (int [], int); const int MAX … |
|
Hi guys, I need some help with arrays. [ICODE] #include <iostream> #include <ctime> using namespace std; void constructArray (int [], int); void printArray (int [], int); const int MAX = 30; int sizeArray = rand() % MAX; int main() { srand(time(NULL)); int makeArray [sizeArray]; constructArray [makeArray, sizeArray]; printArray [makeArray, sizeArray]; … |
|
Hi, I need some help with an assignment. Got some problems with my while loop. Can't seem to figure out what's wrong with it. [code=cpp] #include <iostream> #include <string> #include <bitset> using namespace std; int last (int num) { int l; l = (num % 10); return (l); } int … |
|
Hi, I did some C++ assignments and was confused about a certain code. [CODE=language] #include <iostream> #include <iomanip> using namespace std; int main() { long result, input, num, count; count = 0; cout << "key in number"; cin >> input; while (input>0) { count++; input /=10; } cout << count; … |
|
Hi, I'm a student new to C++, just started learning it for 3 weeks. I just encountered a problem in making a multiplication table as an assignment. Tried alot of methods but still can't figure out what's wrong. [code=cpp]#include <iostream> #include <iomanip> using namespace std; int main() { int input, … |