Unit 1, Assignment 1 JMB

5
Jeff Brown Unit 1 Assignment 1 Class # ET2560T Homework Answer questions. Page 43, numbers 1-4, 8-10. and page 44, numbers 3-9. 1) A Compiler translates a high-level language program into the machine language. 2) An operating system provides access to system programs for editing, and compiling. 3) Specify the correct order for these operations: execution, translation, linking, loading. translation, linking, loading, execution 4) A high-level language program is saved to a disk as a source file. 8) Computer programs are software components of a computer system. 9) In a high-level or assembly language, you can reference data using variables rather than memory cell addresses. 10) Secondary storage is composed of units such as disks, flash drives, etc. Anything that retains the data stored even when power is lost. Review Questions: 3) List 2 input devices, 2 output devices, and 2 secondary storage devices:

description

C Programming Homework

Transcript of Unit 1, Assignment 1 JMB

Page 1: Unit 1, Assignment 1 JMB

Jeff BrownUnit 1 Assignment 1

Class # ET2560T

Homework

Answer questions. Page 43, numbers 1-4, 8-10. and page 44, numbers 3-9.

1) A Compiler translates a high-level language program into the machine language.2) An operating system provides access to system programs for editing, and compiling.3) Specify the correct order for these operations: execution, translation, linking, loading.

translation, linking, loading, execution

4) A high-level language program is saved to a disk as a source file.

8) Computer programs are software components of a computer system.

9) In a high-level or assembly language, you can reference data using

variables rather than memory cell addresses.

10) Secondary storage is composed of units such as disks, flash drives, etc.

Anything that retains the data stored even when power is lost.

Review Questions:

3) List 2 input devices, 2 output devices, and 2 secondary storage devices:Input devices Output devices Secondary storage devices

1. Keyboard 1. Monitor 1. Hard Drives2. Mouse 2. Printer 2. Flash Drive

4) Describe three categories of programming languages.

1. Machine language: A language directly understood by the computer,

binary numbered codes are understood by a CPU.

2. Assembly language: A language in which computer operations are

represented by mnemonic codes rather than binary numbers and variables

can be given names rather than binary memory addresses.

3. High-level language: A machine-independent programming language that

combines algebraic expressions and symbols taken from English.

Page 2: Unit 1, Assignment 1 JMB

Jeff BrownUnit 1 Assignment 1

Class # ET2560T

5) What is a syntax error?

A violation of the programming language’s grammar rules, detected

during program translation (compilation).

6) What processes are needed to transform a C program to a machine language

program that is ready for execution?

Before a high-level language program (C program) can be executed, it

mustfirst be translated into the target computer’s machine language.

The program that does the translation is called a compiler.

7) Explain the relationship between memory cells, bytes, and bits.

The memory of a computer as an ordered sequence of storage locations

called memory cells, an individual storage location in memory. A

memory cell is actually a grouping of smaller units called bytes. A byte

is the amount of storage required to store a single character. A byte is

composed of even smaller units of storage called bits. The term bit,

deriving from the words binary digit, is the smallest element a computer

can deal with.

8) Name three high-level languages and describe their original usage.

Language Application Area Origin of Name

FORTRAN Scientific programming Formula translation

LISP Artificial Intelligence List processing

Prolog Artificial Intelligence Logic programming

Page 3: Unit 1, Assignment 1 JMB

Jeff BrownUnit 1 Assignment 1

Class # ET2560T

9) What are the differences between RAM and ROM?

Main memory stores programs, data, and results. Most computers have

two types of main memory: random access memory (RAM), which

offers temporary storage of programs and data, and read-only memory

(ROM), which stores programs or data permanently. RAM temporarily

stores programs while they are being executed (carried out) by the

computer. RAM is volatile memory, which means that everything in

RAM will be lost when the computer is switch off. ROM, on the other

hand, stores information permanently within the computer. The

computer can retrieve (or read), but cannot store (or write), information

in ROM, hence the name, read-only. Because ROM is not volatile, the

data stored there do not disappear when the computer is switch off.

1. Write an algorithm in pseudo-code to solve the following problem:Input a temperature in Fahrenheit, and output the temperature in Celsius and Kelvin.The formulas needed are:

C = (5/9) (F – 32)K = (5/9) (F – 32) + 273.15

Algorithm:Pseudo-code1. Start2. Output “Enter Temperature in Degrees Fahrenheit”3. Put in number4. Put in Celsius = (5/9) (number – 32)5. Output “Temperature in Celsius”, Celsius6. Put in Kelvin = (5/9) (number – 32) + 273.157. Output “Temperature in Kelvin”, Kelvin8. End