- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 12
- Posts with Downvotes
- 11
- Downvoting Members
- 9
34 Posted Topics
what is a way to get numbers in 2 diff columns one column is whole numbers and the other are numbers with decimal places [CODE]int price=' '; // i am attempting to grab a number that has a decimal but its not the correct way int itemnum=' '; // i … | |
im trying to figure out how i count the number of 5 letter words in a file and the number of 6 or greater words in the same file using a string. all the examples are at higher level of programming im just a beginner. my books very briefly tells … | |
i cant figure out why this error is coming up saying that "exams" are undeclared identifier. all of them? // basic file operations [CODE]#include <iostream> #include <fstream> using namespace std; void read_file_in_array(int exam[100][3]); double calculate_total(int exam1[], int exam2[], int exam3[]); // function that calcualates grades to see how many 90,80,70,60 … | |
could i get help with the syntex on reading a file to an array in c++. all the examples i see are more ![]() | |
I cant seem to figure out why this program wont write to a .txt I commented out the meaning of each step and it looks like i am doing everything correct. If i can get it to write it and goto the following steps. [CODE] float price,curr_total=0.0; int itemnum, wrong=0; … | |
[QUOTE]in the files in_stream2 and 4 they wont open correctly but the rest of them will and i cant move forward until i fix it. i dont even no where to start when trying to fix it could someone help?[/QUOTE] [CODE]ifstream in_stream; // reads itemlist.txt ofstream out_stream1; // writes in … | |
error C2297: '>>' : illegal, right operand has type 'void' error C2296: '>>' : illegal, left operand has type 'float' error C2297: '>>' : illegal, right operand has type 'void' warning C4552: '>>' : operator has no effect; expected operator with side-effect. i get these errors and i dont know … | |
I cant figure out how to import a file which contains the price of an item. and once i import the price idk how to put it in my program. AND I DONT TO USE IT AN ARRAY. I AM IMPORTING EACH ITEM ONE AT A TIME. [CODE]void main () … | |
I cant figure out why this D::D:: is coming up when i generate a random number. idk i looked at other pages and the code looks fine . [CODE] int roll_hold( char answer1, char answer2) { int numb_on_dice1,numb_on_dice2,play1, play2,next_player,play1_total, play2_total; char f,s;// first and second player. cout<< " Would you … | |
how do i return to another part of the program like the begining [CODE] if ( letter=='y') { return letter; }[/CODE] i want it to return back to a prototype [CODE] int roll_hold( char answer1, char answer2)[/CODE] | |
i have my questions commented in the program . i had to put most of program up so you could see what im doin. please help PROTYPES [CODE]void side_on_die(int& ns1,int& ns2,int& ns3, int& ns4, int& ns5, int& ns6); int roll_hold(int roll, int answer, int turn); int if_roll(); void if_hold();[/CODE] [CODE]int … | |
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; i am having trouble putting functions in int main(). can someone show me how??? i want to put these function def. in int main() [CODE]int score_num(int& ns1,int& ns2,int& ns3, int& ns4, int& ns5, int& n6, char& gam_answ); int roll_hold(int roll, int … | |
can someone show me an example of how you would initiate a variable and how you would fix a undeclaired identifiers. i am a visual learner so thats why i ask for an example. | |
i want this code to keep track of whose turn it is: but i keep getting this error : error: a function-definition is not allowed here before '{' token any help [CODE]void turn_it_is(int play1, int play2) { cout << ((turn_it_is%2)==1)?(play1:play2)<< cout << " it's your turn "; cin>> turn_it_is; }[/CODE] | |
i get this error and idk know y anyone know wat i gotta fix [CODE]int main () { int total_score, print_score, action, whose_turn, go_again; cout << "Race to 100 " << endl; total_score = score_num(int &ns1,int &ns2,int &ns3, int &ns4, int &ns5, int &n6, char gam_answ); print_score= display_score(int curr_score); action= … | |
i want this code to do the action, which is generate a random number 1-6. i am totally lost here ive been looking at examples and this is what i have. i get the error function def is not allow here before "{" token. [CODE]void roll_hold( char remark) { if(remark=='r') … | |
can someone tell me what i am doing wrong #include<iostream> using namespace std; [CODE]void char play_again(char letter, char 'y', char 'n'); [/CODE] [CODE]void char play_again( char letter, char 'y', char 'n') { char 'y', 'n'; char letter ; cout << " Would you like to play agian?( press y or … | |
i got errors and i cant find out what they meant i have went down the program line by line trying to figure them out and i am having no success. I am trying to use call by call values and parametrers n this program. (list of errors are below) … | |
error: default argument for `int&ns1' has type `int'. i cant figure out why this error is popping up it says the error is on line 3, anyone know how to help? [CODE]#include<iostream> using namespace std; void score_num(int &ns1=0,int &ns2=2,int &ns3=3, int &ns4=4, int &ns5=5, int &n6=6, char gam_answ); void display_score(int … | |
i am having a problem getting a random number 1-6 on an invisible dice and storing the number. i get this error |error: at this point in file| for this code: [CODE]void roll_hold( char answer, int turn) { if(answer=='r') { do { (rand(turn)% (char& ns1=0,char& ns2=2,char& ns3=3, char& ns4=4, char& … | |
im trying to practice on: Basic User Defined Functions/ Pass by Value Functions for class and im confused. this code has a problem with it, its not printing everyting i want it to say. can someone help me understand this and what i am doing what wrong and what i … | |
Im trying to figure out how i will calculate items needed. for example for every 500 sqft of space, one gallon of paint and 8 hours of labor is required. how will i put that n to a formula | |
i cant get this to loop and i cant get it to error trap cout << " Please choose an odd number 3-9 to calculate width and height of your choosing\n"; cin >> number; [CODE]do { if((number!=3) || (number!=5) || (number!=7) || (number!=9)) { cout << "invalid choice " <<endl … | |
quick question how will i go about setting setting up characters to draw a shape such as a triangle. but the user must pick an odd # that equals to the shape . the one i have is simple but idk how to input the number the user choosen to … | |
Did i use the code tag correctly ? let me know? Im trying to figure out how to error trap this program so if the user doesnt put in a valid response then a message will cum up and they will go back 2 the beginning until they do it … | |
i cant figure out why this outputs the wrong number when i say the length and width is 1 it outputs 2293544. and i dont know if its reading the 2 numbers i put in for length and width i use the magic formula and still does it case 'B':; … | |
[CODE]I cant get this to read these numbers correctly 11.95f, SQFT2 = 12.35f, SQFT3 = 13.28f, PI = 3.14159f, when i run it , the answer comes out to be a whole number 11.[/CODE] i also need help on the do while loop i almost got it but i ended … | |
i keep getting 4 errors on here and i cant figure out what they are I followed the syntax i believe [CODE] } if (( tot_mon <= 0.0f && orig_mon <= 0.0f)) cout << "You need more cash, you dont have enough\n" << endl; else if (tot_mon <= 0); cout … | |
ok how will i keep track of the items i bought? i have not the slightest clue on that. i dont even know where to start. can someone point me in the right direction? [CODE]#include<iostream> using namespace std; int main() { char symb; int item_purch, numb_item_purch, quit,; double mug = … | |
How would i keep track of money spent? and items bought when i loop and how do i say i want multiple items meaning if i want to purchase more than one teeshirt or mug. /* SIUE's bookstore is having aspecail sale on tiems embossed with the cougar logo. For … | |
Im trying to figure out how to error trap this program so if the user doesnt put in a valid response then a message will cum up and they will go back 2 the beginning until they do it correctly. also i want to subtract the money they spend and … | |
How can i make this into a menu where you select a letter and you get a response that reads you have choosen "a" which is $2.50 /* SIUE's bookstore is having aspecail sale on tiems embossed with the cougar logo. For a limited time, three items, mugs, teeshirts, and … | |
this message is coming up i cant get it off ERROR C2447 [CODE]#include<iostream> using namespace std; int main(); { int item_purch, numb_of_purch, quit; char ('A' || 'a'), ('B' || 'b'), ('C' || 'c'), ('D' || 'd'); double mugs, teeshirts, pens, tot_mon, curr_cash, mon_spent; cout << "Welcome to the Southern Illinois … | |
and this what is a better way too write this without getting an error if ((symb1 != 'A', 'a') || (symb2 != 'B', 'b') || (symb3 != 'C', 'c') || (symb4 != 'D', 'd'));; << endl; { cout << "Please enter an corresponding letter." << endl; } and this what … |
The End.