Thread: 2confused

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    8
    Rep Power
    0

    2confused


    if anyone could help me with this, i will be greatful.
    it's a 2part question:

    ENTER THE FOLLOWING:
    DESCRITPION <ENTER> A
    WEIGHT <ENTER> 2.0
    PRICE/LB. <ENTER> 1.98

    i would have to print the input information along with the total cost of the purchase.

    here is the second part: the output. i have to piece all this together . i really don't know if this is correct. i just know that
    i to declare alot of things, but don't a clue of where to start with that and how. PLEASE HELP!!!

    /OUTPUT RESULTS


    cout<<setiosflags(ios::fixed| ios::showpoint|ios::right);
    cout<<"***********************************************" ;
    cout<<setw(65)<< "PENNY SPENDER SUPERMARKET"<<setw(10)<< endl;
    cout<<setw(30)<< "PRODUCE DEPARTMENT"<<setw(10)<<endl;
    cout<<" "<<endl;
    cout<<setw(10)<<"ITEM"<<setw(20)<<"WEIGHT"<<setw(20)<<"COST/lb"<<setw(20)<<"COST"<<endl;
    cout<<setw(7)<<"A"<<setw(20)<<endl;
    cout<<setw(7)<<"B"<<setw(20)<<endl;
    cout<<setw(7)<<"C"<<setw(20)<<endl;
    cout<<setw(7)<<"D"<<setw(20)<<endl;
    cout<<" "<<endl;
    cout<<setw(30)<< "Thank You!!"<<setw(10)<<endl;
    cout<<" "<<endl;
    cout<<"***********************************************" ;
    cout<<setprecision(2);
    cout <<endl;
    return 0;


    }
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    You need to be more specific on what you problem is. Does it compile with errors you can't resolve? Does it run but crash?

    As for input, read up on 'cin'. We generally avoid doing your homework for you, but are happy to offer advice on how to fix your problems once you have created them.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Flint, MI
    Posts
    328
    Rep Power
    13
    At this point the best advice I can give you is to sit down with your professor in his/her office hours to get the help. If you show up to class this clueless, and you haven't been to office hours, your prof will justifiably have no sympathy for you.

    Use that resource before turning here for help. It's not that we won't help you, but it gets you a lot more to talk with your prof. I also recommend attending any open lab sessions, or working with somebody else in the class. Just make sure that you don't turn in two copies of the same code. Even with the same assignment, two programmers don't generate the same code.
    Clay Dowling
    Lazarus Notes
    Articles and commentary on web development
    http://www.lazarusid.com/notes/

IMN logo majestic logo threadwatch logo seochat tools logo