desperate help with while statements!!

This is a discussion on desperate help with while statements!! within the C++ Programming forums, part of the General Programming Boards category; i am in computer programming in school and i went and took off two days of school because my brother ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    1

    Unhappy desperate help with while statements!!

    i am in computer programming in school and i went and took off two days of school because my brother was flying in from iraq and i am two programs behind and i need to get them caught up by tomorrow and i have NO IDEA how to do these programs.! can you please help???!


    we start all our programs with this:

    #include <iostream>
    using std::cin;
    using std::cout;
    using std::endl;

    #include <conio.h>

    int main ( )
    {




    the first one i have to do it says to do this:

    a large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a program that uses a while statement to input each salesperson's gross sales for last week and calculates and displays that salesperson's earning. Process one salesperson's figures at a time.



    the second on says this:

    Use a while statement to determine the gross pay for each of several employees. The company pays "straight time" for the first 40 hours worked by each employee and pays "time-and-a-half" for all hours worked in excess of 40 hours. You are given a list of the employees of the company, the number of hours each employees worked last week and the hourly rate of each employee. Your program should input this information for each employee and should determine and display the employee's gross pay.

  2. #2
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    195
    You really should use code tags.

    As the problems you are having, are you expecting someone to just post the code you need? Because I can tell you right now, that isn't how it works on here. My advice to you would be to google 'C while loop tutorial' or something like that (in fact cprogramming.com - this site - has tutorials on this). Read the tutorials, have a go at doing the program and if you have difficulty come back to this forum to ask specific questions. If you want people to help you, you need to show an initial attempt at the problem first, so if you do come back with more specific questions, make sure you post the code you have written (using tags).

  3. #3
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,409
    we start all our programs with this:

    #include <iostream>
    using std::cin;
    using std::cout;
    using std::endl;

    #include <conio.h>

    int main ( )
    {
    Thanks so much for dropping that big hint, that really clears the matter up knowing you start programs including stuff
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  4. #4
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by rogster001 View Post
    Thanks so much for dropping that big hint, that really clears the matter up knowing you start programs including stuff
    lol, I think he wanted us to write the programs using his "handwriting" so he could just turn it in without thinking about it.
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,409
    haha, i think you may be right, or that would defo be a good idea, maybe thats the tutor's gameplan, to fox students that get stuff done for them, people not in the class would probably write using the whole namespace, and probably not conio.h either, so if he sees any of that, you busted! haha
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  6. #6
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by rogster001 View Post
    haha, i think you may be right, or that would defo be a good idea, maybe thats the tutor's gameplan, to fox students that get stuff done for them, people not in the class would probably write using the whole namespace, and probably not conio.h either, so if he sees any of that, you busted! haha
    lol, yeah, I keep having to stop myself from giving people who keep asking for us to do their homework for them a working solution, except written in Lisp

    (although it's mostly because I've never gotten a Lisp compiler to work though, and it only attracted my attention because of it's awesome syntax)
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Skipping If Statements?
    By CBecker5000 in forum C Programming
    Replies: 1
    Last Post: 11-08-2009, 03:05 PM
  2. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 03:09 AM
  3. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 10:42 AM
  4. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM
  5. Need help with "if" statements
    By Harryt123 in forum C Programming
    Replies: 22
    Last Post: 05-14-2006, 08:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21