Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

KINGDOM OF SAUDI ARABIA | JAZAN UNIVERSITY

COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS


ASSIGNMENT-1 : 2020-2021
Academic Year 1443-44H Semester 2nd
Course with code Programming 1 (COMP-011/112) Section 1607
Type of Assignment Question and answer Max. Marks 10 Marks
Date of Announcement 12-Feb-2021 Deadline 18-Feb-2021

Student Name Student ID

ASSIGNMENT PROBLEM STATEMENT


(Theory)

1. What is the different between compiler and interpreter?


1 Marks

Compiler Interpreter

Java code ----- java bayt code


Java bayt code------- machine code

2. What is the different between syntax and semantics?


1 Marks

Syntax Semantics

The arrangement of words and punctuations that are legal


in a language, the grammar rules of a language The meaning of things written while following the syntax
rules of a language
3. Write the output of a program. 1 Marks

public static void main(String[] args){ Ans


‫الكود خطا عشان‬
int length=5, width=3; ‫دبل االقواس‬
error
int area;

System.out.println("\n The area:

"+(length*width));

System.out.println("\n The area:"+area);

4. Filled up the primitive types table 1 Marks

Type Name Kind of value Memory used


byte integer 1 byte
int integer 4byte
float Floating –point numper 4byte
double Floating –point numper 8byte

5. Write a program in Java that display a Triangle with stars as shown in the output Screen-
short. Two (3) Marks
Guideline for developing the application.
Program Output
Public class Test{
Public static void main(String[] args){

System.out.println("*");
System.out.println("**");
System.out.println("***");
System.out.println("****");
System.out.println("*****");
System.out.println("******");

6. Develop an application program in in Java that can perform ANY of the following two
operations:
a. Summation of 2 numbers (3) Marks
b. Multiplication of 2 numbers

Guideline for the Application


Program Output

Name of the Course Teacher Dr. Awatef Balobaid Signature A.B.

You might also like