editing, compiling, executing and submitting programs · pdf file [[email protected] abcd1234]$...

Click here to load reader

Post on 05-Aug-2020




0 download

Embed Size (px)


  • Editing, Compiling, Executing and Submitting Programs

    Quick Start Compile step

    once always

    mkdir labs javac Realtor.java

    cd labs Execute step

    mkdir 0 java Realtor

    cd 0 Submit step

    emacs Realtor.java & submit csc156abc 0

    Calculating Based Upon Home Sales

    For most employees who happen to work in sales, salary is often based upon calculations that are determined by a percentage of their sales. This is sometimes the case for calculating taxes as well. For this assignment, the transaction involved is the sale of a house. There is the cost associated with the sale that is arbitrarily determined to be 6% of the sales price of the house, while the sales person’s commission is just as arbitrarily determined to be 1.5% of the sales price of the house.

    Each percentage is, of course, representable as a fraction with 100 as the denominator. Consequently, 6% is 0 to 6

    100 while 1.5% is equivalent to 1.5 100 =

    15 1000 . Consequently, if we are interested in calculating the percentage of a

    value, we simply multiply the equivalent fraction of the percentage by the value. For example, let’s assume that the sales price of our house is $100,000. To determine the cost and 0 associated with 3 the house, we want to know the following.

    cost = 6% of $100,000 = 6100 · $100, 000 = 0.06× $100, 000 = $6, 000 commission = 30% of $100,000 = 1.5100 · $100, 000 = 0.015× $100, 000 = $1, 500

    Operating systems and Graphical User Interfaces

    Since the days of the first electro-magnetic computers, operating systems have provided software that allows users to control a variety of tasks that are necessary to effectively use the machine. Think of the operating system commands as software that is already written to control the machine. In other words, you don’t have to write it. There are actually several operating systems that constantly need to interact within Oakton’s Local Area Network (LAN). The network servers usually run a network operating system such as Novell’s. These are necessary for a variety of telecommunications activities such as loading software on your machine from a remote location or printing a file on one of the Oakton LAN printers. When you begin your computer session in any of the Oakton labs, your identity is first verified by a Novell server and then the machine in front of you boots the Microsoft Windows operating system. Most of the applications that are used in the Oakton laboratories run under the Microsoft Windows operating system. When the time comes for you to actually program, you will


  • CSC 156 - Assignment 0 Realtor

    telecommunicate with another computer, unseen by you, that is running the LINUX operating system. This means of working on a computer that you are not physically sitting in front of is the state of the art in networked computing.

    Most of your experience with operating systems may actually have been filtered through a graphical user interface (GUI) such as those found at your ATM, on your cellular phone or a GPS mapping system. This is a set of software applications that allow you to use a pointer device such as a mouse to communicate your commands by clicking on icons and menu selections rather than having to type them in at the keyboard. How tightly an operating system is integrated with its GUI can vary from one operating system to another. When the Microsoft Windows interface first came out, it was loosely installed onto the MS-DOS operating system that was running on the machine making it possible to run applications through either the Microsoft Windows GUI or from the MS-DOS prompt. With the introduction of Microsoft Windows 95, the GUI became far more integrated to the underlying operating system. The MS-DOS prompt is still accessible, but it is becoming more and more difficult to find any software that can be successfully run from that environment. Users of early Apple products such as the Apple IIe also had access to a command prompt from which they could issue commands. The Macintosh was the first commercially successful desktop machine that possessed a Windowing environment that removed the need of the command prompt. Like all operating systems, UNIX has a GUI available to it as well, called X. This will provide you with functionality similar to the MacOS or the Microsoft windowing environments, but will also have access to a command prompt.

    Logging into your UNIX account

    The name of Oakton’s LINUX machine is csc.oakton.edu. LINUX acts very similar to UNIX, but does not have the licensing fees associated with it that UNIX has. This is how the developers of LINUX have been able to give their product away over the Internet. If you are logged into one of the Oakton computers under the Microsoft Windows environment, you will need to begin your telecommunications session to csc.oakton.edu through software called ssh. This will allow you to telecommunicate in a non-graphical manner with a remote computer. Use the mouse to click on the Start icon, then find the text field entitled Search programs and files on the bottom of your screen. Type Putty in that window to search for that application and launch the software by clicking on the entry that appears with the ssh icon shown in Figure 1. Modify the Host Name, Port and

    Figure 1: ssh Icon for Invoking Putty

    Connection type options in the configuration menu to reflect the values shown in Figure 2. Then, click on the Open button.

    The first time that you run ssh, you will be prompted to confirm the authenticity of the host (in this case, csc.oakton.edu). Reply Yes to the prompt regarding your interest in continuing to connect. You will then be prompted for your LINUX userid and your LINUX password. The userid is the same as your Oakton network userid. Your initial password for this account is your Oakton Banner id which is a capital B or capital A followed by 8 digits. Passwords are not displayed on the monitor, so watch the keyboard as you enter the values in. Once you are logged into the LINUX machine, we want to set up the parameters that are necessary for us to telecommunicate in a graphical environment. Begin by executing the following command to initiate the VNC server software.


    You will be prompted for your VNC password which we recommend should be your regular Oakton network


  • CSC 156 - Assignment 0 Realtor

    Figure 2: Putty Configuration for csc.oakton.edu

    password (not the Banner id number discussed above). You will need to verify this password by typing it in twice, but you will only need to do this step the first time that you run vncserver. The command will respond with a statement that indicates the VNC port number. For example, the following response indicates that your VNC session can use port 16. Remember your port number for this session, it may be different every time that you login.

    New desktop is csc:16

    If you’ve never installed the RealVNC Viewer application on your machine, you’ll need to download it and install it from the following URL. http://www.realvnc.com/en/connect/download/viewer Run the application once it is installed.

    When prompted for the VNC Server type the following address into the frame text box where VNC port number was the value returned by the

    vncserver command. csc.oakton.edu:VNC port number For instance,

    in this example you would enter the server as csc.oakton.edu:16 You may need to relax the firewall settings on your virus protection software to complete the next step.

    You will then be prompted for your VNC password. Once again, use the same password that you used in response to the vncserver command above.

    When your desktop opens, find the Applications menu at the top of your frame and then find the System Tools

    sub-menu. Within System Tools , find the Terminal application and click on that. A window called an X-

    terminal, or xterm will open up and display a command prompt that is waiting for you to enter in commands. If your userid is abcd1234, the command prompt might look something like the following.



  • CSC 156 - Assignment 0 Realtor

    [[email protected] abcd1234]$

    In this discussion, anything that you should type into the computer will be typeset in a boldfaced monospaced font such as this font. The response that the computer makes will be an italicized version of the same font such as this font. When we wish to discuss commands that we’re not immediately interested in your typing in, we will use a normal monospaced font, such as this font. There are a variety of UNIX commands that you can type in at the command prompt, some of which are described in the Oakton UNIX Quick Reference Guide. We’ll demonstrate a few of them below.

    Some essential commands

    The final portion of the command prompt that is displayed in your xterm is not only your userid, but it is also your home directory. File systems are partitioned into directories to help organize them. When you login to your LINUX account, you will be automatically placed into your home directory. Your home directory is a sub-directory of another directory, which in turn can be a sub-directory of yet another directory. This continues up until the root of the directory system, which unlike other operating systems, is designated with a slash /, rather than a letter of the alphabet, c:.

    To discover the path to your current the directory, you can use the Print Working Directory (pwd) command. Type this in at your xterm prompt and strike the return key.


    The response should look something similar to the following. Don’t concern

View more