Total members 9952 | Gratitudes |It is currently Sat Feb 11, 2012 2:40 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 7 posts ] 
Author Question
 Question subject: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Sun Nov 09, 2008 5:22 pm 
Offline
Newbie
User avatar

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 :confused:


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Sun Nov 09, 2008 8:06 pm 
Offline
Mastermind
User avatar

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 )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Sat Dec 06, 2008 11:23 pm 
Offline
Mastermind
User avatar

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 )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Mon Dec 08, 2008 3:12 pm 
Offline
Newbie
User avatar

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


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Mon Dec 08, 2008 3:42 pm 
Offline
Mastermind
User avatar

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]);
}
}


int main()
{
char oldarray1[5] = {'a','b','c','d'};
char newarray2[5];
touppercase(oldarray1, newarray2);
cout << newarray2 << endl;
}

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Thu Dec 25, 2008 11:27 pm 
Offline
Moderator
User avatar

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


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Please Help!!... I'm new in programming in c/c++ and I need
PostPosted: Fri Dec 26, 2008 12:41 am 
Offline
Mastermind
User avatar

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 )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 7 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 programming  C-C++  Anonymous  0
 c++ programming  General Discussion  Anonymous  1
 programming  Java  Anonymous  1
 Programming  C-C++  Anonymous  1
 ALP programming  C#  jissokalias1970  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team