Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

code for program :)

xlildiva89xxlildiva89x Posts: 3Member
this is the program that i need to write, i am copying it word for word:

Riley Residence Hall charges different rates for semester room and board
based on the number of meals per day the student wants. the semester rate with no meals is $300. with one meal per day, the rate is $450. with two meals per day, the rate is $520, and with three meals per day, the rate is $590. store these rates in an array. write a program that allows a student to enter the number of meals desired per day. output the semester room and board rate. name the file SemesterMeals.cpp


if someone could please help, i cant afford to fail this class

Comments

  • LundinLundin Posts: 3,711Member
    What part of it do you need help with? What is it you don't understand. Please ask specific questions.
  • Malcolm_McLeanMalcolm_McLean Posts: 248Member ✭✭
    : this is the program that i need to write, i am copying it word for
    : word:
    :
    : if someone could please help, i cant afford to fail this class
    :
    :
    The program is too trivial to offer much help on. You need only one function, which is main.

    Output a question using printf() or cout to prompt the user the enter the number of meals.
    Input the answer using scanf("%d", &N) or cin >> N;
    Check it is in the range 0-3, and if not output an error mesage and terminate.
    Do a switch and print out the room rate and board rate for your four possibilities, again using printf() or cout.

    The logic is simple

    switch(N)
    {
    case 0:
    /* print out message for 0 meals here */
    break;
    case 1:
    /* print out message for 1 meal here */
    break
    etc
    }

  • xlildiva89xxlildiva89x Posts: 3Member
    : What part of it do you need help with? What is it you don't
    : understand. Please ask specific questions.

    ok i have gone through 3 professors for this class i havent learned anything i dont know what i am doing, all i need to do is pass this class so i can switch my major, i've read the book inside and out and still cant grasp what to do if someone would be kind enough to code these extra credit assignments for me then ill pass the class and then i will never take another programming class again....
  • LundinLundin Posts: 3,711Member
    Code begging without any effort made by the original poster is against the forum policies, so normally your post would have been deleted. However, Malcom was kind enough to reply still.
  • winkygizerwinkygizer Posts: 1Member
    : : this is the program that i need to write, i am copying it word for
    : : word:
    : :
    : : if someone could please help, i cant afford to fail this class
    : :
    : :
    : The program is too trivial to offer much help on. You need only one
    : function, which is main.
    :
    : Output a question using printf() or cout to prompt the user the
    : enter the number of meals.
    : Input the answer using scanf("%d", &N) or cin >> N;
    : Check it is in the range 0-3, and if not output an error mesage and
    : terminate.
    : Do a switch and print out the room rate and board rate for your four
    : possibilities, again using printf() or cout.
    :
    : The logic is simple
    :
    : switch(N)
    : {
    : case 0:
    : /* print out message for 0 meals here */
    : break;
    : case 1:
    : /* print out message for 1 meal here */
    : break
    : etc
    : }
    :
    : How long did you learn it to write such things?
    : __________________________________
    : [link=http://www.digeus.com/program/junkcleaner/index.html]Junk Vista[/link]

  • LundinLundin Posts: 3,711Member
    : : How long did you learn it to write such things?


    I'd say one or two weeks.
  • xlildiva89xxlildiva89x Posts: 3Member
    : : : How long did you learn it to write such things?
    :
    :
    : I'd say one or two weeks.


    excuse me...ive actually been in this class for almost 15 weeks...and have gone through 3 instructors..and i am just now being introduced to this kind of stuff...sorry that i dont get things right away!!!!!!!!!!!!!!!!!!!!
  • LundinLundin Posts: 3,711Member
    I refer to 1-2 weeks of full-time study.

    Anyway, that class doesn't sound too good... I'd get a good C/C++ book and study it instead. There are decent online tutorials too.
Sign In or Register to comment.