






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This would be the first lab od CS-212 in NUST.
Typology: Lab Reports
1 / 30
This page cannot be seen from the preview
Don't miss anything!























nd
The purpose of this Lab is to familiarize students with the programming environment that they will be using throughout this course for software development purposes. This lab introduces the basics of NetBeans IDE and demonstrates how IDE software facilitates the process of programming. After completing this lab you will be able to use different features of Netbeans IDE. Your first activity will be creating a simple "Hello World" program using Java. As you carry out the steps in this lab, it is important to think about what you are seeing and to understand what's going on. The more attentive you are here the fewer headaches you'll have later!
The students will know how to download, install and use NetBeans IDE. Further they will learn how IDE software facilitates the process of programming.
Talk to your classmates for help. You may want to bring your textbook to future labs to look up syntax and examples. Stuck? Confused? Have a question? Ask a TA/Lab Engineer for help, or look at the book or past lecture slides. Before you leave today, make sure to check in with one of the Lab Engineers/TAs in the lab to get credit for your work.
An IDE is more than just a text editor: it’s a set of integrated tools that assist you with the typical development workflow of coding, testing and debugging, profiling, compiling, running, and deploying applications. With NetBeans IDE, it is easy to effectively write your code, manage and build large software projects, and maintain control of multiple file revisions in a team environment.
NetBeans IDE is a free, open source, popular, integrated development environment used by many developers. Out of the box, it provides built-in support for developing in Java, C, C++, XML, and HTML applications. NetBeans IDE is available for Windows, Mac, Linux and Oracle Solaris. The NetBeans platform and IDE are free for commercial and non-commercial use, and they are supported by Sun Microsystems.
Additionally, you may press the green arrow to Run your project. As shown above, the program output appears inside the Output panel in NetBeans
A popup window about Usage Statistics may appear when you start NetBeans. If you would like to participate in anonymous information being sent to NetBeans to help them improve the program, click on I Agree. Otherwise, you may wish to say No, Thank You. Debugging Your Programs
int i=0; i++; i++; i++; System.out.printf(“%d\n”,i); The file should look like the one shown below:
In this case we selected in the source code at line 21.
It shows that indeed, i has the value of 3, when it will be displayed to the console.
It will automatically indent, put spaces in between variables and assignments, and fix other formatting issues. Consider the code sample, before formatting is applied to it: After selecting Format option from the source menu, code takes the following form i.e. indentation and spacing is fixed: Printing Your Source Code
1. From the File menu, select Print.
3. Select Line Numbers and Wrap Lines. Then press OK.
4. Now the preview shows the line numbers and the text wrapped on the page. Press Print to Print your file. Exporting / Importing If you want to move your project to another machine, you can Export it.