Cashback Offer from 4th to 8th August 2021. Get Flat 10% Cashback credited to your account for a minimum transaction of $80. Post Your Question Today!

Question DetailsNormal
$ 18.00

CIS355 Q7 | Complete Solution

Question posted by
Online Tutor Profile
request

For Project 1: Using any java compiler complete the following 6 questions below:

Ensure that you write java code for each question

Project I: Using DOS Commands with Java

 

1.       Create two files called: File1.txt and File2.txt

 

Print Screen below here and copy and paste code:

 

Here is the code:

import java.util.Formatter;

 

import javax.swing.JOptionPane;

 

 

public class Files

{

 

       public static void main(String[] args)

       {

              final Formatter x, h;

             

              try

              {

                     x = new Formatter("File1.txt");

                     h = new Formatter("File2.txt");

                     JOptionPane.showMessageDialog(null, "The following file " + x + "has been created");

              }

              catch(Exception ex)

              {

                     JOptionPane.showMessageDialog(null, "Error the file has not been created" + ex);

              }

       }

 

}

 

2.       Create a new Folder called: Folder1

 

Print Screen below here and copy and paste code:

 

Folder1 has been created in C:\\

 

Here is the code:

import java.io.File;

 

 

public class NewDirectory

{

 

       public static void main(String[] args)

       {

              File file1 = new File("C:\\Folder1");

             

              if(!file1.exists())

              {

                     if(file1.mkdir())

                     {

                           System.out.println("Directory is created!");

                     }

                     else

                     {

                           System.out.println("Failed to create the directory");

                     }

              }

       }

}

 

3.       Move #1 (2 files) into Folder1 using the Move command

 

Print Screen below here and copy and paste code:

 

4.       Create another folder called Folder2

 

Print Screen below here and copy and paste code:

Here is the code:

import java.io.File;

public class Directory2

{

 

       public static void main(String[] args)

       {

              File file1 = new File("C:\\Folder2");

             

              if(!file1.exists())

              {

                     if(file1.mkdir())

                     {

                           System.out.println("Folder 2 is created!");

                     }

                     else

                     {

                           System.out.println("Failed to create Folder 2");

                     }

              }

       }

}

 

5.       Cut file1.txt into Folder2

 

Print Screen below here and copy and paste code:

 

6.       Delete file1.txt from Folder2

Print Screen below here and copy and paste code:

Available Answer
$ 18.00

[Solved] CIS355 Q7 | Complete Solution

  • This solution is not purchased yet.
  • Submitted On 01 Sep, 2015 12:40:49
Answer posted by
Online Tutor Profile
solution
This Tutorial is rated A+ p...
Buy now to view the complete solution
Other Similar Questions
User Profile
Exper...

CIS355 Q7 | Complete Solution

This Tutorial is rated A+ previously,if you have any questions regarding this tutorial then you can contact me....

The benefits of buying study notes from CourseMerit

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35