0% found this document useful (0 votes)
14 views3 pages

Life 2-Review3-Mid1

This document contains an assignment for a Programming 1 course at Jazan University in Saudi Arabia. The assignment [1] asks students to define the differences between a compiler and interpreter and between syntax and semantics. It also [2] asks students to identify the output of a sample code and fill in a primitive data types table. Finally, it [3] provides guidelines for students to create two programs - one that prints a triangle of stars and another that performs a basic mathematical operation like addition or multiplication of two numbers.

Uploaded by

fabas2453
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Life 2-Review3-Mid1

This document contains an assignment for a Programming 1 course at Jazan University in Saudi Arabia. The assignment [1] asks students to define the differences between a compiler and interpreter and between syntax and semantics. It also [2] asks students to identify the output of a sample code and fill in a primitive data types table. Finally, it [3] provides guidelines for students to create two programs - one that prints a triangle of stars and another that performs a basic mathematical operation like addition or multiplication of two numbers.

Uploaded by

fabas2453
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy