Thread: No idea where to start for this program

  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    13

    Angry No idea where to start for this program

    Write a program to allow a user to input 10 integers. If more than half of the integers are over 80, then print “high tide.” otherwise print “low tide”


    Any help is appreciated. I am a student who has only been studying C programming for a week

    Thank you guys so much

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What is your idea, and what have you tried?
    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
    Sep 2013
    Posts
    13
    I wanted to make a counter variable and add 1 to it everytime a number is greater than 80. Then if counter is over 5 itll output "high tide." But im kind of lost

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    It sounds like you have an algorithm that might work. It might help for you to sketch out this algorithm (e.g., on paper) as pseudocode or a flow chart. Then start with a skeleton program with a main function, and translate your pseudocode/flow chart into C code. Compile at every few complete lines of code so that you will catch any syntax errors (e.g., due to a typo error) early.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 10-24-2012, 10:05 AM
  2. No idea where to start with this program that needs loops...
    By Rockiroad278 in forum C Programming
    Replies: 2
    Last Post: 11-25-2007, 05:56 PM
  3. need a idea to start
    By keeper in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-25-2006, 03:36 AM
  4. have no idea where to start (not a project)
    By misplaced in forum C++ Programming
    Replies: 2
    Last Post: 10-10-2004, 06:48 PM
  5. number guessing game, no idea where to start
    By karin in forum C Programming
    Replies: 9
    Last Post: 03-18-2004, 09:49 PM