Assessement of Lesson 1
Assessement of Lesson 1
COSC-1336
Assessment of Lesson1
Exercise 1.
What is a computer? What is a CPU? What is a memory? How a computer works?
Computer - A computer consists of a Central Processing Unit (CPU), memory, hard disk, floppy disk/USB,
monitor, printer, and communication devices.
CPU - The CPU is the “brain” of a computer. It retrieves instructions from memory and executes them.
Memory - The memory stores data and program instructions to be send to CPU for execution.
How a computer works – The computer runs through on and off switches and uses the machine language
(Binary) to communicate with the human language.
Exercise 2.
What is the monitor resolution?
Monitor Resolution - The resolution specifies the number of pixels per square inch.
Pixels (short for “picture elements”) are tiny dots that form an image on the screen.
Exercise 3.
What is Software Programming?
Software Programming - are instructions to the computer. You tell a computer what to do through
programs. Computers do not understand human languages, so we need to use computer languages to
communicate with them.
Exercise 4.
What is a programming language? How many categories of programming languages exist? Give examples of high-
level languages?
Programming language is used to tell a computer what to do through program because computers don’t
understand human languages.
Exercise 5.
What are source code, compiler, and object program?
Compiler – Programs called compilers are used to translate the source program into a machine language
Object Program – Linked with other supporting library code before the object can be executed on the
machine
Exercise 6.
What are the main Java programming language characteristics?
The answer is that Java enables users to develop and deploy applications on the Internet for servers,
desktop computers, and small hand-held devices.
Java is a general purpose programming language.
The future of computing is being profoundly influenced by the Internet, and Java promises to remain a big
part of that future.
Exercise 7.
What is object-oriented programming? What are the differences between traditional programming and object-
oriented programming? Give examples to illustrate these concepts.
Object-oriented Programming - An object is a fundamental entity in a Java program. Objects can be used
effectively to represent real-world entities
Traditional - The conventional approach tends to consider data and behavior separate.
Conventional approach: one large room with scanners and printers.
OOP - The object-oriented approach considers data and behavior together in a concept called class.
Object-oriented approach: two smaller rooms, one with scanners and the other one with printers.
Exercise 8.
What is a Java bytecode? What is the Java virtual machine?
Java Bytecode - With Java, you write the program once, and compile the source program into a special type
of object code, known as bytecode.
Exercise 9.
Give examples of the three types of Java comments and explain the differences between them.
Paragraph comment: A paragraph comment is enclosed between /* and */ in one or multiple lines.
javadoc comment: javadoc comments begin with /** and end with */.
Exercise 10.
What are the benefits of using Javadoc in your Java programming?
They can be extracted into an HTML file using JDK's javadoc command.
Exercise 11.
What is a Java reserved word? Give examples of Java reserved words.
Reserved words – Words that have a specific meaning to the compiler and cannot be used for other
purposes in the program.
Exercise 12.
What is a Java Modifier? Give examples of Java Modifier.
Modifier - Java uses certain reserved words called modifiers that specify the properties of the data,
methods, and classes and how they can be used.
Ex. public, static, private, final, abstract, protected
Exercise 13.
What is a Java statements? Give examples of Java statements.
System.out.println("Welcome to Java!");
Exercise 14.
What is a Java class? Give examples of Java classes.
Exercise 15.
What is a Java method? Give examples of Java method.