Thread: How to use the absolute function?

  1. #1
    Registered User
    Join Date
    Jan 2013
    Location
    TEXAS
    Posts
    4

    How to use the absolute function?

    The table below shows the normal boiling points of several substances. Write a program that prompts the user for the observed boiling point of a substance in ºC and identifies the substance if the observed boiling point is within 5% of the expected boiling point. If the data input is more than 5% higher or lower than any of the boiling points in the table, the program should output the message "Substance unknown."

    So this is my problem, I figure to use the absolute function and then divide it with a known substance value and compare it to 0.05 to determine the substance. This is my first month learning a computer program. This is what I have so far...

    I have not learned the if statements but I want to get this first and I think I can learn the if statements on my own.

    Thank you!


    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    you should really put your code in code tags instead of attaching as a file. also don't bold your whole post. it's annoying.

    you definitely need if statements for this program. I don't see any way around that.

    what do you actually need help with here?

  3. #3
    Registered User
    Join Date
    Jan 2013
    Location
    TEXAS
    Posts
    4
    My apologies for the posting. I figured out this problem. Thank you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get absolute value efficiently
    By greendragons in forum C Programming
    Replies: 21
    Last Post: 06-13-2012, 03:29 AM
  2. Absolute beginner
    By bluenose90 in forum C# Programming
    Replies: 11
    Last Post: 06-03-2010, 10:42 PM
  3. Absolute Value Function
    By Govalant in forum C Programming
    Replies: 9
    Last Post: 05-30-2007, 06:39 AM
  4. I have seen absolute evil...
    By Scourfish in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 06-22-2002, 01:43 PM