You are on page 1of 2

Kingdom of Saudi Arabia ‫ﺔﻳﯾﺩدﻭوﻌﺳﻟﺍا ﺔﻳﯾﺑﺭرﻌﻟﺍا ﺔﻛﻠﻣﻣﻟﺍا‬

 
Ministry of Education     ‫ﻡمﻳﯾﻠﻌﺗﻟﺍا ﺓةﺭرﺍاﺯزﻭو‬
Jazan University
 
College of Computer Science & Information Technology   TYPE  -­‐  A‫ﺔــﻌـﻣﺎــﺟ‬
  ‫ﻥنﺍاﺯزﺎـــــﺟ‬
‫ﺔﻳﯾﻠﻛ ﻡمﻭوﻠﻋﻭو ﻰﻟﻵﺍا ﺏبﺳﺎﺣﻟﺍاﺔﻳﯾﻧﻘﺗ ﺕتﺎﻣﻭوﻠﻌﻣﻟﺍا‬

ACADEMIC YEAR 2018-2019 SECOND SEMESTER


EXAM-1

Course: Programming-1 Code: CSC-011 Section:

Student Name:__________________________________ Student ID:________________________

Exam Date: Signature of CT:___________________

Exam Duration: 50 Minutes Max. Marks: 10 Marks awarded:

SECTION – A ( 4 x ½ = 2 Marks)
Answer ALL questions. Each question carries HALF mark

Choose the correct answer:

1. C++ and Java are examples of:

a) High-level language b) Low-level language c) Machine language

2. public, class, int, double and void are:

a) Keywords b) Values c) Variables

3. What is the right assignment value for the variable x:


char x = …….
a) A b) “A” c) ‘A’

4. The y value in this code is ……..


double x = 2.5;
int y = (int) x;

So, y =…..

a) 2.5 b) 25 c) 0

SECTION – B (4 x 1 = 4 Marks)
Answer any FOUR questions. Each question carries ONE mark

 
1. What is a programming language?
…………………………………………………………………………………………………………....

2. Write a Java statement to convert the below variable from double to int.
double  x=3.2;  

CSC-011/Exam1
 
     
     
…………………………………………………………………………………………………………....
3. Define the term Syntax Error and give an example.
…………………………………………………………………………………………………………....

4. Correct this program (2 Errors).


The corrected Program:
public  class  Sum  {  
 
public  static  void  main(String[]  args)  {  
 
int  1a=6;  
double  b2=3;  
   
System.out.print(a+b);  
 
         }  
 
}  

5. Write a correct initialization of a String type variable named MyName, and its value is Your name.
……………………………………………………………………………………………………………

 
SECTION - C (1 x 4 = 4 Marks)
Answer any ONE of the questions. Each question carries ONE marks
 
 
Q1: Complete the 4 missing parts in the following piece of code:

Q2: Write a Conditional Java Statements to do the following:


— Check if a number is a divisible by 2 OR 3.
— Check if a number is positive AND divisible by 5.

GOOD LUCK

CSC-011/Exam1
 

You might also like