Posts

Tips / Guidelines for Students for Final Year Projects (FYP) Presentations

My 5 final year students have a BSCS project pre-defense in coming days. One of them asked for some tips for good online presentation. Here are some quick points, if you are also presenting your academic project, please consider: 1. Claim only what you have done yourself, never make a wrong statement or that you may not justify. Otherwise, you would make your small contribution a waste and the examiner would assume all you work is copied. Claiming less work is far better than claiming more that you have not done yourself. 2. Do not spend too much time on basics e.g. history, problem statement, technologies, etc. if your project is not noval e.g. MIS system or a website. It kills the examiner's interest. Your other job is to keep the examiner interested in your presentation. So present important, challenging, valuable stuff first, that you feel would be new or interesting for the examiner. Keeping the examiner interested is your core responsibility and you do it sharing the right con…

PHP 7.4 Functions - Exercise

You must be using PHP 7.4, as some of features mentioned below may not be available in PHP earlier versions.

Create multiple short programs using PHP that shall perform the functionality described below. You shall be able to do most of stuff if you have attended PHP Functions lecture but some functionality may require you to read more on web to complete, to help you in self learning.

Program #1. Write a PHP function that shall take an integer parameter representing year. Your function shall return a boolean representing whether the year is a leap year or not. Mention the type on prototype but do not use strict_type mode. If user passes, a non integer data, you functions hall return null.
Program #2. There is a special type of function in PHP, call variadic functions or variable length arguments. Make a function that user shall call passing none, single or any number of numeric paramters. The function shall return sum of all numbers. If nothing is passed as argument, the function shall …

JavaScript Assignment - Web Technologies

Image
Above is the User Interface of how your application shall look alike. Make a web page using HTML/CSS (you may use Bootstrap) and JavaScript. When user fill the form and click 'add' button, the record shall be added in the table on the left side of page. 'Action' column shall contain Update and Remove links, "Update" shall load the record in the form on right. When user update the values and press 'update' button, it shall update the corresponding row in the table on left. Initially, when the page is loaded, the table shall be empty and "Update" button shall be disabled. When user click the "Update" link shown under 'Action' column, "add" button shall be disabled. The "reset" button shall reinitialize the form at the same state when the page was loaded to add new records, so it shall make the add button enabled. The page shall not reload during these operations, so it shall be a single page app.

Under Ci…

Write Output of Java Program - Exam Sample Questions

Answers are given at end.

1public class StringTest {
public static void main(String args[]){
String t1=new String("Text");
String t2=new String("Text");
System.out.println(t1==t2);

String t3="Text";
String t4="Text";
System.out.println(t3==t4);
System.out.println(t1==t4);
System.out.println(t1.equals(t3));
}
}

2public class ExceptionTest {
 public static void main(String[] args) {
     try {
System.out.println("Welcome to Java");
int[] a = new int[10];
a[10] = 1;
System.out.println("Welcome to Python");
    } catch (Exception ex) {
System.out.println("There is an exception”);
    }
    System.out.println("Bye.");
 }
}


3class A{
    public int x = 1;

public A(int i){
x += i;
}
}

class B extends A {
public B(int i){
super(i);
x += i;
}
}

public class  Test{
public static void main(String args[]) {

    A arr[] = new A[2];
        arr[0] = new A(1);
        arr[1] = new B(2);
        System.out.println(arr[0].x + arr[1].x);
}
}


4class A {

Object Oriented Programming OOP Multiple Choice Questions MCQ - Samples for Exam

There are 60 questions in this post. Set 1 containd 30 and Set 2 also contains 30.
Solutions of each set is given after each set of questions.

Questions Set 1:

1.What is the output of the following code?
1: public class ArithmeticSample { 2: public static void main(String[] args) { 3: int x = 5 * 4 % 3; 4: System.out.println(x); 5: }}
A. 2 B. 3 C. 5 D. 6 E. The code will not compile because of line 3.
2.What is the output of the following code snippet? 3: int x = 4; 4: long y = x * 4 - x++; 5: if(y<10) System.out.println("Too Low"); 6: else System.out.println("Just right"); 7: else System.out.println("Too High");
A. Too Low B. Just Right C. Too High D. Compiles but throws a NullPointerException. E. The code will not compile because of line 6. F. The code will not compile because of line 7.
3.Given the following classes, what is the maximum number of imports that can be removed and have the code still compile? package aquarium; public class Water { } package aquarium; import java…