You are on page 1of 2

KINGDOM OF SAUDI ARABIA | JAZAN UNIVERSITY

COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS


ASSIGNMENT-1 : 2023-2024
Academic Year 2023-2024 Semester 2
Course with code Programming 1 Section
Type of Assignment Question and answer Max. Marks 10 Marks
Date of Announcement Deadline 15-01-2024

Student Name Student ID

ASSIGNMENT PROBLEM STATEMENT


(Theory)

1. Write the output of each line. 5 Marks

Ans

1- int r=19, y=3; 1-………………………….

System.out.println("\n The value="+r%y);

2- System.out.print("My name is:Asma”)); 2-………………………….

System.out.print("My age is:22”));

3- System.out.println("\t Java Programming”);


3-………………………….
4- int n=15;
4-………………………….
int m=5;

double ans = n / (double)m;

System.out.println(ans);

5- System.out.println("The value is " + 10 ); 5-………………………….


2. Identify from the following: 3 Marks
//This code has my name and my ID

public class Ex
{
public static void main(String[] args)
{
System.out.print("My Name is: Ahmad ");
System.out.print("My ID is: 20901234 ");

} }

i) What is the class name from the above?


ii) Method?
iii) Statements?
iv) Comments?

3. Filled up the Variable Name Table with the valid or invalid: 1 Marks

Name valid / invalid


8sum
Book Title
bookName
A_7b

4. Write a Java program to accept the day from the user and display the following using
chained if-else statement. (1 Mark)

day=6 and day=7 - Holiday


day=1 or day=2 - Working day
day=3 or day=4 – Middle days

Name of the Course LAILA BIN LEBDAH Signature


Teacher

You might also like