Question subject: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Sun Nov 09, 2008 5:22 pm
Joined: Sun Nov 09, 2008 5:12 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
Hello Everyone I'm new to c/c++ programming and I need help with this asignment Please!! Help......(Sales Commissions) Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $3000 in sales in a week receives $200 plus 9% of $3000, or a total of $470. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount): 1. $200-299 2. $300-399 3. $400-499 4. $500-599 5. $600-699 6. $700-799 7. $800-899 8. $ 900-999 9. $1000 and over
msi_333
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Sun Nov 09, 2008 8:06 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
i thought in the following for you create array to count all size of 9 ( remember index is from 0-8 )
if the income is fro example 200$ , 200/100 equal 2 and (2-2) equal 0 and so on .
Code:
int grosses=30000; int income=0; for(int i=0;i<sizeof(myarr);i++) { income=grosses*0.9+myarr[i]; if(income>=1000) { counterarray[8]++; } else { counterarray[((int)income/100)-2]++; }
}
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
msi_333
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Sat Dec 06, 2008 11:23 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
did it help you ?
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
karentassone
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Mon Dec 08, 2008 3:12 pm
Joined: Sun Nov 09, 2008 5:12 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
Yes the code did help..Thank you..
I have another program I need help with if you don't mind.
I need to write that inputs a line of text with function gets into char array s[ 100 ]. output the line in uppercase letters and in lowercase letters.. Again I thank you.. Karen
msi_333
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Mon Dec 08, 2008 3:42 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
this is example use toupper function in C++ library
Code:
#include <iostream> #include <ctype.h>
using std::cout; using std::endl;
void touppercase(char *oldarray1, char *newarray2) { for(int i = 0; i <= strlen(oldarray1); i++) { newarray2[i] = toupper(oldarray1[i]); } }
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
biskot188
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Thu Dec 25, 2008 11:27 pm
Joined: Fri Nov 21, 2008 6:18 pm Posts: 51 Location: thessaloniki Has thanked: 0 time Have thanks: 2 time
hey mate stop solving their homework let them do some code themselves then we can help them out with it .... if we give them the answer they ll never learn anything ...
_________________ if you want make an effort yourself no one will make it for you... best regards
msi_333
Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
Posted: Fri Dec 26, 2008 12:41 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
ok
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )