Thread: Algorithm to C++ Conversion Help, PLEASE!!!!!

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    2

    Algorithm to C++ Conversion Help, PLEASE!!!!!

    I need help generating C++ code from the fallowing algorithm. Thank you.

    PayCalc

    1. CaseOf
    PayCode = "H"
    Pay = Rate * Hours
    PayCode = "P"
    Pay = Rate * NoPieces
    PayCode = "C"
    Pay = Commission * Sales
    PayCode = "S"
    Pay = Salary
    EndOfCase

    2. Exit

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Sure: C++ Tutorials. You may find of particular interest Lesson 5: Switch Case.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Yeah, we have a 2-step algorithm here as well.

    step 1

    Step 2

    Show some effort, to show us what you may/may not understand, then we can talk.

    What isn't going to happen is you getting a complete answer on a plate with no more effort on your part.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    2
    oh hush im looking for resources like that video that guy sent me too as well, im working on it, im new

  5. #5
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by cstudento View Post
    oh hush im looking for resources like that video that guy sent me too as well, im working on it, im new
    It shows how much you're 'working' on it ! ...Not even a click...

    std::Video + Code = T***L
    Last edited by manasij7479; 08-21-2011 at 03:32 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# to C++ conversion?
    By hammari in forum C# Programming
    Replies: 8
    Last Post: 03-18-2011, 12:51 AM
  2. conversion
    By ashok449 in forum C Programming
    Replies: 2
    Last Post: 03-04-2008, 03:35 AM
  3. Replies: 5
    Last Post: 04-12-2006, 06:30 PM
  4. Conversion!!!
    By GT70sgt in forum C++ Programming
    Replies: 1
    Last Post: 11-19-2003, 07:51 PM
  5. my grandfather's chess algorithm can beat your grandfather's chess algorithm...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 22
    Last Post: 08-17-2001, 06:52 PM