A9 — Early programming languages
Create a Fortran program.
Due Oct 28, 2026
Estimated time to complete (just the assignment, excluding the prep materials): 40–60 minutes.
Prep materials: Week 9: History of computing continued
What to do
Submit your work to Assignment 9 on Brightspace, along with a few quiz questions in there.
Part 1: Getting started with Fortran
FORTRAN’s name is short for Formula Translation. It is one of the oldest high-level programming languages, and it was designed primarily for scientists to write formulas similar to how they write them on paper. The compiler turns those formulas into machine code.
Go to LFortran in the browser.
Replace the example program by the following code:
Here,
print *instruction means “print whatever follows the comma, using the default format”.Press the Run button and copy the entire output (including the
Hello from 1957!line) into your assignment submission.
Part 2: Fahrenheit to Celsius conversion
This program converts temperature stored in f from Fahrenheit to Celsius using the formula \[(f − 32) × 5/9,\] stores the result in c, and prints the conversion information to the screen:
program convert
real :: f, c
! Convert temperature from Fahrenheit to Celsius
f = 50.0
c = (f - 32.0) * 5.0 / 9.0
print *, f, 'degrees F is', c, 'degrees C'
end program convertreal :: f, ccreates two variables that hold numbers with a decimal point; you can think of variable names as labels for memory cells.!starts a comment, which the compiler ignores.c = ...evaluates the formula on the right side, then stores the result in the variablec.
Do the following:
Run the program and copy the entire output into your assignment submission.
Change the value of
fto 100.4 and run the program again. What is the new value ofc? What is the printed value off? What might be happening here? Write down your observations and thoughts.At the end of the program (after
printbut beforeend program), add lines that convertcto Fahrenheit using the formula \(c × 9/5 + 32\), then print the result. What do you observe? Write it down.Experiment with multiple different values of
f, including2.1. What do you observe about the output? What might be happening here? Write down your observations and thoughts.Copy your final program and the final output to your assignment submission.
Grading
Graded for correctness of the program and completion of observations.