Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:11:50+00:00 2026-06-13T20:11:50+00:00

I have a program that is supposed to tell a user if a temperature

  • 0

I have a program that is supposed to tell a user if a temperature they entered is absolute zero. If indeed it is, then they should see “no entropy for you”, if it is greater, then It should tell them how far above a0 they are, but i keep getting messages saying my if statements have errors, and have no idea where to start, can anyone help me out here?

PROGRAM Project2

CHARACTER(1):: tempType
REAL:: k, f, c
REAL:: temp
REAL:: answer

PRINT *, "What is the temperature type?"
READ *, tempType
PRINT *, "whats the temp?"
READ *, temp

k = 0.0
c = -273.15
f = -459.67

answer = getMinTemperature(tempType)
PRINT *, answer


CONTAINS

FUNCTION getMinTemperature(tempType)
REAL:: getMinTemperature
CHARACTER(1), INTENT(IN):: tempType
REAL:: temp
DO i = 1, num
IF(ACHAR(tempType(i)) <= temp .AND. k > temp) THEN
 k= 0.0
 getMinTemperature = k
 EXIT
ELSE IF (c <= temp .AND. c > temp) THEN
 c= -273.15
 getMinTemperature = c
 EXIT
ELSE IF ( f <= temp .AND. f > temp) THEN
 f=-459.67
 getMinTemperature = f
 EXIT
END IF
END DO

END FUNCTION

END PROGRAM Project2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:11:51+00:00Added an answer on June 13, 2026 at 8:11 pm

    Assuming it’s a homework, I’ll just give you a couple of pointers rather than the answer. First of all, reconsider the logic of your program. Do you really need that loop over i?
    Then, look up the first google hit for achar. Do you really need it? Also notice that your code compiles if you comment out the line with achar, so that it is the latter which interferes with the intent(in) attribute of the function argument.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that is supposed to interact with a web server and
I have a small program that's supposed to sample some value from a device
I have a program for the iPhone that is supposed to be doing intelligent
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have a program that is supposed to send a file to a web
I have a button in my program that supposed to be clicked after a
I have simple serial port program that is supposed to read the serial port
I have a java program that is supposed to run a bat file, and
I have recently made a program that is supposed to take two environment variables,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.