Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Need help in C

    Comments & Feedback
    c program
    3
    4
    978
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dilshan Lakshitha
      Dilshan Lakshitha last edited by Dilshan Lakshitha

      Assignment එකකට C දන්න උදව් කරන්න පුළුවන් කෙනෙක් ඉන්නවද? ටිකක් urgent.

      1 Reply Last reply Reply Quote 0
      • root
        root Linux Help last edited by

        c nam karala na hebei c++ nam karala thiyenawa. mokadda karanna one kiyala dannko kattiya help karai

        1 Reply Last reply Reply Quote 0
        • Dilshan Lakshitha
          Dilshan Lakshitha last edited by Dilshan Lakshitha

          hotel reservation system එකක් හදන්නේ. මට කරන්න තියෙන්නේ කෑම ඔර්ඩර් කරන function එක.total එක final bill එකට calculate වෙන්න ඕනේ.code එකක් හම්බුනා ඒක complex වැඩි. මේ පහල තියන එකේ idea එක අරගෙන GNU GCC Compiler එකට ලියන්න ඕනේ.

          https://pastebin.com/TZNUsGSW

          lahirunc 1 Reply Last reply Reply Quote 0
          • lahirunc
            lahirunc @Dilshan Lakshitha last edited by lahirunc

            @Dilshan-Lakshitha Machan first of all this is a community and it's not a place where you get other people to code for free of charge. Even if we wanted to I'm pretty sure most of us don't have enough time but what we can do is help you when you get stuck in some place or you don't know what to do next. Without out giving an effort, there won't be any help.

            Ok now let me give you a basic idea how this should be developed.

            1. Get all the Menu Items and prices into a .txt file

              eg: - Fried Rice 180
              Fried Noodles 200
              etc.

            2. Using file reading function read them at the start and get it into a 2D array and print them accordingly.

              it should be showed to select. (This may vary according to user's preference)
              eg:-

              1. Fried Rice - Rs. 180
              2. Fried Noodles - Rs 200
                etc.
                999.Done
            3. Let the user select using the input method. Make sure the above said is in a loop. I prefer while loop.

            4. Each time the user selects an item add it to an array. I recommend using just numbers as you already have food items on another array.
              eg:-

                    int foodArr[200] = {2,5,9}
              
            5. Then at the end of the ordering process when user hits that 999 or Done. Calculate the ordered food array and print it out.

            Try this method and see. Else come back to us and someone else or me would be able to help you.

            1 Reply Last reply Reply Quote 2
            • 1 / 1
            • First post
              Last post

            0
            Online

            3.7k
            Users

            1.3k
            Topics

            5.3k
            Posts

            • Privacy
            • Terms & Conditions
            • Donate

            © Copyrights and All right reserved Lanka Developers Community

            Powered by Axis Technologies (PVT) Ltd

            Made with in Sri Lanka

            | |