Code the given java application

Assignment Help JAVA Programming
Reference no: EM13906902

1. Using NetBeans, code the following Java application, and run it on Command prompt (Terminal If Linux) with the argument "notepad" (or "gedit" if Linux).

import java.io.*;

public class DSProcess

{

public static void main(String[] args) throw IOException

{ if (args.length! = 1) {

System.err.println('Usage: Java OSProcess <command>"), System.exit(0):

}

// args(0) is the command that is run in a separate process

ProcessBuilder pb = new ProcessBuilder(args[0]);

Process process - pb.start();

// obtain the input stream

InputStream is - process.getInputStrean();

ImputStreamReader isr = new InputStreanReader(is);

Bufferedheader br = new BufferedReader(isr);

// reed the output of the process String line;

while ( (line = br.readLine()) != null)

Systen.out.prIntln(line);

br.close();

}

}

Provide screen shots for,

- NetBeans code screen

- command prompt or terminal screen when you run the application.

You should run the application with the command;

Java -jar OSProcess. jar notepad

or

java -jar OSProcesa . jar gedit

2. Run the command puree on your Ubuntu virtual machine you have installed in Assignment 1. you should run the command on a terminal screen in Ubuntu. Provide screen shot of the full tree.

Reference no: EM13906902

Questions Cloud

Hector company reports the following : Depreciation expense is $ 2,300 per month. Prepare a schedule of budgeted cash disbursements for August andSeptember.
Implements the postfix evaluation algorithm : Write a program that implements the postfix evaluation algorithm that is on your course module.your program should enable users to enter the postfix expression and output the result of evaluation to screen.
Current approaches for treating the disorder or condition : Write a 3,500- to 4,200-word paper outlining current approaches for treating the disorder or condition you selected.(Depression in HIV Patients) Describe the theoretical basis for the approaches. Present details on how the counselor would work indi..
Cash for purposes of constructing statement of cash flow : Which of the following would be considered a "use" of cash for purposes of constructing a statement of cash flow? a. An increase in accounts payable b. An increase in prepaid expenses c. An increase in accrued liabilities d. An increase in accumulate..
Code the given java application : Using NetBeans, code the following Java application, and run it on Command prompt (Terminal If Linux) with the argument "notepad" (or "gedit" if Linux).
Advantages gained by adopting emr : advantages gained by adopting EMR
What was the total amount of merchandise available for sale : Cost of Goods Sold and Merchandise Available for Sale in a Merchandising Company. Dash Department Store features women's fashions. At the beginning of the year, the store had $531,400 in merchandise. Total purchases for the year were $475,200. What w..
Determining the total number of employees : Write a computer program to print a report with employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose to..
Show that game has an ess that assigns positive probability : Show that the game has an ESS that assigns positive probability only to the demands 2 and 8 and also has an ESS that assigns positive probability only to the demands 4 and 6.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd