C# console application - Programmers Heaven

Howdy, Stranger!

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


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.

C# console application

cowgirl1996cowgirl1996 United StatesPosts: 6Member

I'm extremely new to C# and having a very hard time with this one. Any and all help is greatly appreciated! The more detailed the help the better because I'm pretty lost on this one.

Write a C# console application for a furniture company. Ask the user to choose P for pine, O for oak, and M for mahogany. Show the price of a table manufactured with the chosen wood. Pine tables cost $100, oak tables cost $225, and mahogany tables cost $310. If the user enters something other than P, O or M, set the price to $0. Save your program as Furniture.cs.

Best Answer


  • cowgirl1996cowgirl1996 United StatesPosts: 6Member

    This is what I have so far: using namespace furniture;

    int main() { int a,b,c; double r; char ch,o,m,p;


    cout<< "Enter your spending limit."<<endl; cin>>b; cout<< "Please choose between Pine, Oak, Mahoganhi."<<endl; cin>>ch;

    switch(ch) {

    case 'p':

    a = 100; do { r=c+a; cout<<r<<endl; c=r; } while(r!=b); break;

    case 'o': a=225;

    do { r=c+a; cout<<r<<endl; c=r; } while(r!=b); break;

    case 'm':

    a=350; do { r=c+a; cout<<r<<endl; c=r; } while(r!=b); break; }

    return 0; } } }

  • cowgirl1996cowgirl1996 United StatesPosts: 6Member

    Yes something very similar, but all I need to do is have them pick a type of wood and display the price for that wood.

Sign In or Register to comment.