0% found this document useful (0 votes)
28 views

Lab Assign

This document contains instructions for a programming assignment for a Programming 2 course at Jazan University in Saudi Arabia. It provides 5 questions to answer in a Java program, including calculating areas of cylinders, reversing the order of integers read from user input, printing odd and even elements in an array, working with multi-dimensional arrays, and generating and printing values from a Fibonacci series using recursion. The assignment is due on October 13th, 2023 and late submissions will not be accepted.

Uploaded by

Subuhi Kashif
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lab Assign

This document contains instructions for a programming assignment for a Programming 2 course at Jazan University in Saudi Arabia. It provides 5 questions to answer in a Java program, including calculating areas of cylinders, reversing the order of integers read from user input, printing odd and even elements in an array, working with multi-dimensional arrays, and generating and printing values from a Fibonacci series using recursion. The assignment is due on October 13th, 2023 and late submissions will not be accepted.

Uploaded by

Subuhi Kashif
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

KINGDOM OF SAUDI ARABIA | JAZAN UNIVERSITY

COLLEGE OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY


ASSIGNMENT 2023-2024 FIRST SEMESTER
Course with code Comp-213 (Programming-2) Section 14
Type of task Lab Assignment Marks 10
Date of
3/10/2023 Deadline 13/10/2023
Announcement
Student Name Student ID

Instructions:
 Download the file and submit as a document file.
 Attach Screenshots of the Output.
 Assignments Submissions through Blackboard account
 Late submission not accepted.
 Copying is not allowed.

Question 1: Write a Java program to define and call CalculateAreaCylinder(double height,


double radius) function to calculate the area of three cylinders using Math class with the
following specifications: first cylinder (7,6), second cylinder (4.3 ,2.5), and third cylinder
(- 4.5,6.9). (2 Marks)
Question 2: Write a program that reads ten integers and displays them in the reverse of the order
in which they were read. (2 Marks)
Question 3: Write a Java Program to print odd and even elements in an array. (2 Marks)
Question 4: Write a Java program to create two multi-dimensional arrays, myFirstMatrix, and
mySecondMatrix with the following specifications:
 Initialize myFirstMatrix variable with int type and size of 5x5 or 5-by-5 (i.e., five rows, five
columns).
 Print the value of first index, and the value of last index of myFirstMatrix.
 Initialize mySecondMatrix variable with double type and size of 4-by-3 (i.e., four rows, 3
columns) using Array Initializer.
 Assign the following elements of double type with (1.0, 2.0, 3.0), (4.0, 5.0, 6.0), (7.0, 8.0, 9.0),
(10.0, 11.0, 12.0), and assigns its reference to mySecondMatrix.
 Print the value of first index, and the value of last index of mySecondMatrix. (2 Marks)
Question 5: Write a Java program to generate fibonacci Series using recursion. The program
should also print the value from a location specified by the user. (2 Marks)

You might also like