Final Report
Final Report
Final report
Laboratory 1. Introduction to NetBeans IDE
Subject Code: Section: LAB SCHEDULE:M2:30-4:30
Name: Jomardi L. Castino DATE PERFORMED: June 20, 2017
DATE SUBMITTED: June 20, 2017
GRADE:
Use naming convention: COSC221A_*section*_lab*n*_*surname*_final.doc
Preliminary report
II. Exercises/Research
Research:
What is an IDE and what is the relevance to you?
Answer
An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software development.
An IDE normally consists of a source code editor, build automation tools and a debugger.
Most modern IDEs have intelligent code completion.
How to create a project in NetBeans IDE?
Answer
1. Launch the NetBeans IDE.
On Microsoft Windows systems, you can use the NetBeans IDE item in the
Start menu.
On Solaris OS and Linux systems, you execute the IDE launcher script by
navigating to the IDE's bin directory and typing ./netbeans.
4. In the Name and Location page of the wizard, do the following (as shown in the figure
below):
5. Click Finish.
The project is created and opened in the IDE. You should see the following components:
The Projects window, which contains a tree view of the components of the project, including
source files, libraries that your code depends on, and so on.
Answer
So by saying SDK for Java you are actually referring to the JDK. Assuming that
you are new to Java, there is another term that you'll come across- JRE, the acronym for
Java Runtime Environment. JRE is something that you need when you try to run software
programs written in Java. Java is a platform independent language.
Can you still develop java programs without the JDK installed? Why
or why not?
Answer
You will need JDK for compiling your programs.JRE provides only runtime
environment, but JDK is something you will need to compile your code to make them
executable by your JRE.You will need javac for compiling your code which is present
in JDK.
OUTPUT:
CALENDAR
ARITHMETIC
CODES:
CALENDAR
package javaapplication6;
import javax.swing.JOptionPane;
import java.util.Calendar;
public class JavaApplication6 {
ARITHMETIC
package arithmeticops;
System.out.println("");
System.out.println("i + j = " + (i+j));
System.out.println("j - i = " + (j-i));
System.out.println("i *j = " + (i*j));
System.out.println("i /j = " + (i/j));
System.out.println("i %j = " + (i%j));
System.out.println("i -- = " + (--i));
System.out.println("j ++ = " + (++j));
System.out.println("i ++= " + (++i));
Final report
A. Java and C are similar, especially in syntax. What are the main differences
with the two?
ANSWER
Size of binaries: We mentioned that the two languages are compiled languages that turn your
code into binary files. C# has a lot of overhead and libraries included before it will compile. C++
is much more lightweight. Therefore, C# binaries are much larger after it compiles compared to
C++.
Performance: C++ is widely used when higher level languages are not efficient. C++ code is
much faster than C# code, which makes it a better solution for applications where performance is
important. For instance, your network analysis software might need some C++ code, but
performance is probably not a huge issue for a standard word processing application coded in C#.
Garbage collection: With C#, you dont have to worry much about garbage collection. With C+
+, you have no automatic garbage collection and must allocate and deallocate memory for your
objects.
Platform target: C# programs are usually targeted towards the Windows operating system,
although Microsoft is working towards cross-platform support for C# programs. With C++, you
can code for any platform including Mac, Windows and Linux.
Types of projects: C++ programmers generally focus on applications that work directly with
hardware or that need better performance than other languages can offer. C++ programs include
server-side applications, networking, gaming, and even device drivers for your PC. C# is generally used for
web, mobile and desktop applications.
Compiler warnings: C++ will let you do almost anything provided the syntax is right. Its a flexible
language, but you can cause some real damage to the operating system. C# is much more protected and
gives you compiler errors and warnings without allowing you to make some serious errors that C++ will
allow.
B. When should you use Java and when should you use C?
ANSWER
C++ and Java have a few similarities. These similarities are more relevant to a developer using the language than a
client looking for a developer. You should generally look for a developer who excels in his language of choice, but
the similarities between languages are useful should you find a developer you like to work with and need to edit
code in a different language.
Syntax: Looping structures, classes, defining variables, and conditional operators are very similar in both
languages. This makes it easy for developers to work cross-platform should you have several projects that
use both languages.
Entry points: When your program starts, the compiler or interpreter looks for where it needs to begin
execution. Both Java and C++ look for the main entry point.
Object-oriented: The idea of object orientation is that the languages use classes that represent components
of your program. Each class then contains methods and properties that define it. Both C++ and Java are
object-oriented languages, which makes your program much more modular so you can reuse code for other
programs.
OUTPUT:
CODES:
package divisors;
import java.util.Scanner;
public class Divisors {
for( i=2;i<y;i++){
long z=y%i;
if(z!=0)continue;
System.out.print(i+" , ");
}System.out.println(y);
}