- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re: this one works for me: [CODE=c++]cout<<"Enter number of grade input: "; cin>>numgrade; for (int x=0;x<numgrade;x++) { cout<<"Enter a grade in letter format: "; cin>>usergrade; switch (usergrade) { case 'A': totalgrade+=4; break; //and so on...[/CODE] | |
| Re: since i do not have any knowledge yet about these pointers,i want to ask questions i don't have my source code with me now because i did that at school i did something like this: [CODE=c++]char* color; //then i have these case statements //what i wanted was when a case … |
Re: [QUOTE]Output the numbers and their squares between 1 and 10[/QUOTE] here's a way you can do this: [CODE=c++] int x=1; cout<<"Squares of numbers between 1-10"<<endl<<endl; while(x<=10) { cout<<"Square of "<<x<<" is "<<x*x<<endl; x++; }[/CODE] please analyze the code so you yourself could learn. | |
Re: since you do know that only 5 random numbers will be the input try using arrays after declaring float num1,num2...num5 then have something like [code=c++] float numbers[5]; float temp1; float temp2; int x; int y; numbers[0] = num1; numbers[1] = num2; numbers[2] = num3; numbers[3] = num4; numbers[4] = num5; … | |
Re: try removing fixed and showpoint [code=c++]cout << "sin(" << angle << ") = " << setprecision(4) << sin(angle) << endl; cout << angle;[/code] | |
Re: [QUOTE]amount_purchased-amount_payed = difference;[/QUOTE] assignments should be done like this: [code=c++] difference = amount_purchased-amount_payed;[/code] | |
Re: [code=c++]row - selectedX = 2;[/code] first off,you're lacking an equal sign if you are trying to compare values that part is having an error because you used the assignment(=) operator assignments should be like this: variable_being_assigned = value_to_be_assigned secondly i don't quite get your problem with your if statements,the u,d,l,r … | |
Re: [QUOTE] netincome = yearlygross-totaldeduction/12;[/QUOTE] that should be netincome=(yearlygross-totaldeduction)/12; | |
i'm planning on creating a program for reservations (ex. rooms) by analyzing my problem,the things i don't know how to are: validating the date and whether the room inquired is available or reserved for someone else i'm guessing this will require me to create an output file,which i have no … | |
Re: don't forget to put semicolons after statements anyway, for the additional $15 if balance is < $400 [code=c++] if (begbal<400) total_bank_fees += 15;[/code] equation for check fees: [code=c++] total_check_fees = ppch * checkw;[/code] then just add everything [code=c++] total_bank_fees += total_check_fees;[/code] use do while for the validation of balance [code=c++] … | |
Re: are you referring to the length of the string? strlen | |
Re: [code=c++] tot_cost=pprice*quantity; if (quantity >= 10 && quantity <= 19) { discount = tot_cost * .2; /*percent to decimal conversion: 20%/100% = .2*/ discounted_cost = tot_cost - discount; } [/code] | |
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 … | |
Re: [URL="http://www.bloodshed.net/devcpp.html"]Dev-C++[/URL] for me. you might want to try [URL="http://www.microsoft.com/express/vc/"]MS visualC++ 2008 express[/URL] haven't tried it yet though. | |
Re: here at home i'm using dev c++ and i do get the same "problem" i use system("pause") which i think is not preferred by others,but it's just me using it to see the output then i just remove it when i'm at school because there we use visual c++ OR … | |
Re: what do you mean in this part? [quote]The problem that really drives me crazy is that this code works perfectly when I compile it separately but when I try to put in my main program,instead of writing "Please Enter Date:" then letting me type and then writing "Please Enter Title:" … | |
Re: just an off-topic thought though [QUOTE]For example, July 31, 1929 gives a = 5, b = 31, c = 29, d = 19; January 3, 1988 gives a = 11, b = 3, c = 87, d = 19. Now calculate the following integer quantities:[/QUOTE] shouldn't the century be 20? | |
Re: i was about to ask this question too so what's the proper way? i always do declare globally this one [code=c++]using namespace std;[/code] should i just declare this one globally instead (if i'm using it) using std::cin; using std::cout; | |
i would like to create a program that converts a number system to another i found few ideas on how to do this but lacks explanation so i can't figure out 'how it worked'. found that 'for loop' over the net,did some editing then applied it in a program. here's … | |
here's my code: [code=c++]cin>>figure; switch (figure) { case '1': //figure is circle system("cls"); cout<<"input radius: "; cin>>rad; cout<<"\nsurface area of your circle is "<<pi*rad*rad; break; case '2': //figure is rectangle system("cls"); cout<<"input length: "; cin>>length; cout<<"\ninput width: "; cin>>width; cout<<"\nsurface area of your rectangle is "<<length*width; break; }[/code] 1)when i … |