• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 4 páginas
Otro

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

Document preview thumbnail
Vista previa 1 fuera de 4 páginas

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.

Vista previa del contenido

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.

Libro relacionado
 image
Brian W. Kernighan Understanding the Digital World
Editorial: 2027 ISBN: 9780691288871 Edición: Desconocido

Información del documento

Subido en
7 de noviembre de 2026
Número de páginas
4
Escrito en
2026/2027
Tipo
Otro
Personaje
Desconocido
$7.09

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
7
Última venta
-




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes