Ceng 511 HW

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

COLLEGE OF COMPUTER STUDIES

2 Tri, SY 2022-2023
CENG511 – COMPUTER PROGRAMMING 1
HWAC
Total Points: 20

Student ID Student
Name
Course Code Course Title Section

TOPIC LOOPS IN JAVA

o Answer the following Questions:


⦁ Submission Date: 27th March 2023 Maximum
Marks 20

Q1. Write a program to print the following pattern. *


**
***
****
*****
Q2. Write a java program to print all the even numbers between 20 and 50 using
while loop.

Q3. Write a program that prompts the user to input a positive integer. It should
then print the multiplication table of that number.

Q4. Find the output of the following program.

Import java.util.scanner;

Public class FactorialDemo1


{

Public static void main(String[] args)


{

Prepared by: Reviewed/Checked by: Approved by:

Ms. Aqeela Rishad Dr. Abdulkhader Jilani Dr. Anupama Prasanth


Subject Coordinator Program Head College Dean
Date : Date : Date :

Scanner console = new Scanner(System.in);


int num; //To hold number
int fact = 1; //to hold factorial

System.out.print(“Enter any ppositive integer: “);


num = console.nextInt();

for(int i=1; i<=num; i++)


{
fact *= 1;
}

System.out.println(“Factorial : “+ fact);
}
}
HWAC
OUTPUT

RUBRIC /
MARKING 5 marks for correct syntax and incomplete output
SCHEME 4 marks for partially correct syntax and incomplete output
3 marks if program and output is incomplete
2 marks if only program is included
1bmark for incomplete program and no output

LEARNING ASSESSMENT/MARKING FACULTY/MARKER’S FEEDBACK


ITEM CILOs MARKS MARKS AWARDED
Q1 C5 5
Q2 C5 5
Q3 C5 5
Q4 C5 5
20
TOTAL

Prepared by: Reviewed/Checked by: Approved by:

Ms. Aqeela Rishad Dr. Abdulkhader Jilani Dr. Anupama Prasanth


Subject Coordinator Program Head College Dean
Date : Date : Date :

You might also like