• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Other

COMP 1500 Assignment 8 - Programming Languages, OS Interrupts & Checksum Algorithms (Full Solutions)

Document preview thumbnail
Preview 1 out of 4 pages

Complete, step-by-step solved Assignment 8 for COMP 1500 (Introduction to Computer Science). Features clear answers comparing Fortran, C++, Java, and Python loops and syntax; operating system interrupt priority analysis; a short essay on the origins and design of Go (Golang); and full step-by-step calculations for Credit Card (Luhn) and ISBN-13 checksum verification algorithms.

Content preview

Assignment #8
COMP 1500


1) The textbook has several versions of the algorithm to add up a series of numbers, in
Fortran, C, C++, Java, JavaScript, and Python (pages 77-81).
a) In your owns words, describe the idea of the algorithm. Make sure to include the
important details that matter, while leaving out language specific details.

The algorithm adds up a list of numbers, one at a time. It starts with a running total of 0. Then it
reads the next number, and adds it to the total. It keeps going until there are no numbers left,
which it knows either by counting how many numbers. When the loop ends, the total holds the
sum of every number, and the algorithm prints it.



b) The Fortran example is the only one that doesn’t include the word while to signal
iteration. How does Fortran perform the iterative part of the algorithm?

Fortran is the only example that doesn't use the word while. Instead, it does the iterative part
(the loop) using line labels (numbers like 10 and 20) combined with jumps using if and goto
statements.



c) List 5 examples of how one of the languages expresses part of the algorithm
differently than the others.
- Fortran uses read and write statements, while C++ uses stream operators (cin >>
and cout <<).
- Fortran relies on line labels and goto jumps instead of using the word while.
- Fortran uses .eq. to check equality, whereas C, Java, and Python use = =.
- C, C++, and Java group statements using curly braces {}, while Python uses
indentation.
- C++ requires explicit type declarations like int num;, whereas Python handles
variables dynamically without them.



2) The following four requests could come in to an operating system as it is running on a
computer system:
 The clock in the computer has just ‘ticked’ and we need to update a seconds
counter.
 The program running on processor 2 is trying to perform an illegal operation
code.
 The plug was pulled on the power supply, and the system will run out of power
in 50 msec.

Connected book
 image
Brian W. Kernighan Understanding the Digital World
Publisher: 2027 ISBN: 9780691288871 Edition: Unknown

Document information

Uploaded on
November 7, 2026
Number of pages
4
Written in
2026/2027
Type
Other
Person
Unknown
$7.09

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
7
Last sold
-




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions