Thread: Beginner C programmer, Please Help, Please be patience

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    42

    Beginner C programmer, Please Help, Please be patience

    I am very new to the programming world and I am taking C Language programming and I am having trouble with an assignment. This is the assignment....


    Quote Originally Posted by homework
    Rocklin Realty sells homes. They currently employ 5 realtors (real estate sales people) each with their own code (1-5). Their names are: Larry Lister, Sue Sales, Eva Escrow, Morley Money, and Pete Profit. For each sale, a sales person (realtor) enters their code (1-5) and the amount of the sale. They want to track these total sales by realtor. The report they desire is displayed below:

    Realtor Total Sales
    Larry Lister 1200000.00
    Sue Sales 2450000.00
    Eva Escrow 2200000.00
    Morley Money 4200600.00
    Pete Profit 5400870.00

    Average = 3200000.00
    Total = 15487000.00

    Write a program that creates an array to store the sales totals by realtor. The program loops until all sales are entered, each time asking for a sales person code (1-5) and sale amount, and prompting if there is another one. Each sales person sells many homes. The total sales by realtor is the total of all sales by that realtor, not just one sale. When all the sales figures are entered, the report above is displayed.

    Write 3 functions:

    1. main() - define 2 arrays: the array for total sales and the array for the realtor names, and the variables to store the total sales and average sales. It loops until the user responds with ‘N’ to “Another sale (Y/N): “. Within the loop the program prompts for the realtor code (1-5), prompts for the sale amount, updates the sales array, and prompts for another. After all sales are entered, it calls report() and getaverage(). After the report is displayed, and after the getaverage() is called, print the total and average.
    2. report() - receives the sales array and names array as arguments and displays the report of each sales persons total sales. Use pointer syntax. The total and average are NOT displayed in the report function.
    4. getaverage() - receives the sales array and the address of total and average as arguments. Use pointer syntax. It gets the total and average values from the sales array. It does NOT display the total and average. The total and average are displayed from the main() function in the final lines of code.

    Requrements:
    1. Use prototypes, use appropriate header files, and use pointer syntax for report() and getaverage(). No Globals.

    Grading: No bugs, following directions, style, organization, readability, pointer usage.
    I am not asking how to do the entire assignment, but rather one part. I don't know how to get the desired names to display with the sales. I can get it so the program will display 1-5 where the names should be, but I don't know how to display the names as in the example.

    your patience is greatly appreciated.

    leo
    Last edited by Ken Fitlike; 04-13-2007 at 12:49 PM. Reason: changed [code][/code] to [quote][/quote] tags to reduce horizontal extent

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. beginner c++ programmer compile errors
    By dodo10 in forum C++ Programming
    Replies: 4
    Last Post: 05-28-2008, 04:37 PM
  2. [C] - String Manipulation {Beginner Programmer}
    By INFERNO2K in forum C Programming
    Replies: 14
    Last Post: 05-21-2005, 11:34 AM
  3. Beginner Programmer
    By silverjump in forum C++ Programming
    Replies: 2
    Last Post: 04-04-2005, 06:03 PM
  4. Beginner c++ programmer looking for suggestions....
    By Sheshi in forum C++ Programming
    Replies: 6
    Last Post: 03-08-2003, 04:38 PM
  5. Any beginner C++ programmer wants to.....
    By incognito in forum C++ Programming
    Replies: 5
    Last Post: 12-06-2001, 08:15 AM