Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: emulating commands in c++ Pin
Christian Graus7-Apr-05 15:14
protectorChristian Graus7-Apr-05 15:14 
QuestionWhere to download a crystal report tool from? Pin
awasthy7-Apr-05 13:52
awasthy7-Apr-05 13:52 
AnswerRe: Where to download a crystal report tool from? Pin
liquid_8-Apr-05 7:13
liquid_8-Apr-05 7:13 
GeneralUnhandled Exception. Pin
blinkered7-Apr-05 11:28
blinkered7-Apr-05 11:28 
GeneralRe: Unhandled Exception. Pin
Shaileshhex22-Jul-08 1:50
Shaileshhex22-Jul-08 1:50 
Generalflat toolbar in WinXP Pin
BaShOr7-Apr-05 10:27
BaShOr7-Apr-05 10:27 
GeneralRe: flat toolbar in WinXP Pin
Mark Salsbery15-Nov-06 11:32
Mark Salsbery15-Nov-06 11:32 
GeneralHelp with a school project Pin
diegomiami7-Apr-05 10:02
diegomiami7-Apr-05 10:02 
Here is a program i need to do.. i would like some help..please contact me

here it is:

Write a program to read from an input file the salesperson’s id and their quarterly sales for the year. Compute the total yearly sales, avg sales and commission for each salesperson. You will also compute the company’s total sales. Create a report in this following tabular format:



-----------------Annual Sales Report ------------------


ID QT1 QT2 QT3 QT4 TOTAL AVG COMM

12345 $1,892.00 $4,000.00 $435.00 $1000.00 $7327.00 $1831.75 $2198.10



Total Sales for the Company: //(sum of all the salesperson’s yearly sales)



Requirements:



1. Read from the input file (salesperson_yrsales.dat) the salesperson’s record in the following format: Remember this file will contain several records.

salesperson’s ID#Qsales1#Qsales2#Qsales3#Qsales4



2. Create a structure with the following members.

Salesperson’s ID // salesperson ID number (int),

Qsales1 - // sales for quarter 1 (double)
Qsales2 - // sales for quarter 2 (double)
Qsales3 - // sales for quarter 3 (double)
Qsales4 - // sales for quarter 4 (double)
Yearly sales - // total sales for the year (double)
Avg sales - // the average sales for the year (double)
commission - // sales commission (double)



3. Compute the total yearly sales, average sales and commission amount (30%) for each salesperson.



4. Print a sales report as specified previously to display the sales information. Remember to use padright and padleft.



5. Use the following functions in your program:



a. readFile : This function reads the salesperson’s ID and quarterly sales from the input file and stores the information in the record structure.

b. totalSaleByPerson: This function computes each salesperson’s yearly sales amount,

c. avgSaleByPerson: This function computes each salesperson’s , average sales for the year.

d. commByPerson: This function computes each salesperson’s commission for the year.

e. totalSales: This function computes the company’s total sales by adding yearly sales amount from each salesperson.

f. printReport: This function prints the annual report in the specified format.


I would apreciate someone helping me.Big Grin | :-D


GeneralRe: Help with a school project Pin
Ravi Bhavnani7-Apr-05 11:33
professionalRavi Bhavnani7-Apr-05 11:33 
GeneralRe: Help with a school project Pin
diegomiami7-Apr-05 11:51
diegomiami7-Apr-05 11:51 
GeneralRe: Help with a school project Pin
Ravi Bhavnani7-Apr-05 11:54
professionalRavi Bhavnani7-Apr-05 11:54 
GeneralRe: Help with a school project Pin
David Crow7-Apr-05 16:25
David Crow7-Apr-05 16:25 
GeneralDisableTaskMgr for USER GROUP not with gpedit Pin
nadzzz7-Apr-05 9:26
nadzzz7-Apr-05 9:26 
GeneralRe: DisableTaskMgr for USER GROUP not with gpedit Pin
ThatsAlok7-Apr-05 18:24
ThatsAlok7-Apr-05 18:24 
GeneralPassing 2d char array into SAFEARRAY Pin
act_x7-Apr-05 9:04
act_x7-Apr-05 9:04 
Generalhelp accessing the heap of another process Pin
V.G7-Apr-05 8:45
V.G7-Apr-05 8:45 
GeneralRe: help accessing the heap of another process Pin
David Crow7-Apr-05 9:20
David Crow7-Apr-05 9:20 
QuestionHow to place your program after another in a hook chain ? Pin
maitung7-Apr-05 8:20
maitung7-Apr-05 8:20 
AnswerRe: How to place your program after another in a hook chain ? Pin
David Crow7-Apr-05 9:30
David Crow7-Apr-05 9:30 
GeneralCopying MFC Dialog between projects Pin
C++NewBe7-Apr-05 7:08
C++NewBe7-Apr-05 7:08 
GeneralRe: Copying MFC Dialog between projects Pin
includeh107-Apr-05 7:34
includeh107-Apr-05 7:34 
GeneralRe: Copying MFC Dialog between projects Pin
C++NewBe7-Apr-05 7:52
C++NewBe7-Apr-05 7:52 
GeneralRe: Copying MFC Dialog between projects Pin
includeh107-Apr-05 17:45
includeh107-Apr-05 17:45 
GeneralRe: Copying MFC Dialog between projects Pin
BambooMoon8-Apr-05 8:07
BambooMoon8-Apr-05 8:07 
GeneralRe: Copying MFC Dialog between projects Pin
C++NewBe8-Apr-05 8:41
C++NewBe8-Apr-05 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.