Thread: C programming

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    13

    C programming

    program to write a code claculate grade of student using switch statement in C language or gives an invalid message

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What about it? Is it something that you are supposed to write?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    13
    well i have to write the code can someone help me out using the switch case

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Post your current code.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    This site has a tutorial on that subject here: Switch Case in C and C++ - Cprogramming.com. Beyond that you definitely need to actually ask us a question, post your code, and tell us specifically what problems you're having. You might also want a more descriptive subject: every post in this board is related to C programming

  6. #6
    Registered User
    Join Date
    Sep 2012
    Posts
    48
    TBH a switch / case in this instance is so simple and rudimentary it's hardly more work to copy / paste someone's answer from here than to just look at a tutorial and do it. But if you want a shot at someone helping you, at least post the data types, meaning post the grades and how they average (are certain grades weghted more than others?) otherwise it's just simple number averaging and labeling it "Persons x's grade" which makes it even simpler!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2012, 01:03 AM
  2. Replies: 4
    Last Post: 12-11-2011, 04:25 PM
  3. small programming job VCPP / Object Oriented Programming
    By calgonite in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 01-04-2006, 11:48 PM
  4. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM