Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 14, Problem 2E
Create a
FileInfo fileInfo = new FileInfo(FILE_NAME);
size = fileInfo.Length;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Python: I am trying to write a simple GUI based program with two input fields “Directory/filename” and “word” next to each other and one output text field below. Using recursion the program should go through all the files and folders searching for the entered word. If a match is found the path to the file should be printed in the text field + the content of line the word is found in . It should also print how many folders and files has been searched and how many times the word was found. Any ideas?
PHONE DIRECTORYDescription: Create a phonebook directory that will store the contact numbers of N persons. Your program should allow the user to add, view, delete, and update the contacts in the phonebook. Note that one person can have multiple contact numbers. The program will stop when the user command is ‘X’. Program command and entry should not be case-sensitive. That means commands ‘I’ or ‘i’ and the name “Jacky” or “JACKY” are the same. Each contact number can be 7 digits or 11 digits only.
The user should input a string containing the command, name, and contact number(s) (Limit the contact number of each person to three). This string should be broken down into fields in order to separate the different values and store them in their appropriate variables.
Use linked list in the implementation. Your node must declare at least four instance variables.
Program flow:
Command> I Jacky 09211234567 Remarks: New contact has been added. Command> V Jacky Contact…
Write an application that displays the name, containing folder, size, and time of last modification for the file FileStatistics.java.
Example output:
File name is FileStatistics.java
Folder name is sandbox
File's size is 884 File's creation time is 2018-05-30T16:28:01.410343Z
Chapter 14 Solutions
Microsoft Visual C#
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- You develop a Python application for your school. You need to read and write data to a text file. If the file does not exist, it must be created. If the file has content, the content must be removed. Which code should you use? Group of answer choices open(“local_data”, “r”) open(“local_data”, “w+”) open(“local_data”, “r+”) D. open(“local_data”, “w”)arrow_forwardWrite a C# program FileComparison that compares two files. Two files have been provided for you, Quote.txt and Quote.docx, both containing movie quotes and are located in the /root/sandbox/ directory Next write the file comparison application that displays the sizes of the two files as well as the ratio of their sizes to each other. To discover a file’s size, you can create a System.IO.FileInfo object using statements such as the following, where FILE_NAME is a string that contains the name of the file, and size has been declared as an integer: FileInfo fileInfo = new FileInfo(FILE_NAME); size = fileInfo.Length; Your program's output should look like the following: The size of the Word file is FILE_SIZE and the size of the Notepad file is FILE_SIZE The Notepad file is x% of the size of the Word filearrow_forwardWhen it loads, the list of car objects should be created by reading from the above file. When Add Car button is clicked the following screen should appear: a Add a New Car Model: Year: Çolor. Mleage: Cancel Add When the user fills out new car information and clicks "Add", the new car object is created, the form is closed, so that the main form is shown again, and the newly created car object is added to the list of cars. When "View cars" button is clicked, the following form shows, displaying all car objects currently in the list (use Getlotel) function here. You will also have to send the list of cars from the main form to tis form. To do this in the view form have a public variable for list of cars, and assign to it the list of cars from the main form). ag View Cars Model: Accord, Year.20166 Year. 20166, Color: Blue, Mieage: 0 Model: Passat, Year:2014 Year: 2014, Color: White, Mileage: 20000 Closearrow_forward
- Create a CompanyDriver application. You will have at least 2 methods in this application, Create a menu. main() – setCompanyData() - this reads the data from the file (call the file CompanyData.txt) displayCompanyData() - this displays the data to the screen, calling the toString() method of all objects //sortData() - This will sort the data by choice either name of stock or current price / This will be part of lab 7. //Create an arraylist of the 10 Company objects and display them. You may want to make this a method. This will be part of lab 7 Create an array of the 10 Company objects and display them. You may want to make this a method. Read the data from a file (see below) Call each method as described above CompanyData.txt (the data is set up like this: (Company name, lastprice, current price - copy and paste this into a .txt file) GoPro, Inc.10.7113.69Starbucks59.5358.46JC Penney7.7310.78Amazon531.07576.32Adams Resources and…arrow_forwardThis question comes from the textbook:Starting out with Visual C# 5th Edition - Chapter 14 Programming Problem 2 Create an application that reads the contents of two text files and uses LINQ extension methods to perform the following: • It should display a list of all the unique words contained in both files.• It should display a list of the words that appear in both files.• It should display a list of the words that appear in the first file but not the second.• It should display a list of the words that appear in the second file but not the first.• It should display a list of the words that appear in either the first or second file but not both. Hint: Use set operations to perform these analyses. Also, see Chapter 8 for a discussion of string tokenizing.arrow_forwardjava You may NOT write this program as a GUI (Graphical User Interface). Write a program that reads a file named input.txt and writes a file that contains the same contents, but is named output.txt. The input file will contain more than one line when I test this and so should your output file. Do not use a path name when opening these files. This means the files should be located in the top level folder of the project. This would be the folder that contains the src folder, probably named FileCopy depending on what name you gave the project. Do not use a copy method that is supplied by Java. Your program must read the file line by line and write the file itself. I will test it with a file, input.txt do not write to input.txt* Your class name must be FileCopy.arrow_forward
- java You may NOT write this program as a GUI (Graphical User Interface). Write a program that reads a file named input.txt and writes a file that contains the same contents, but is named output.txt. The input file will contain more than one line when I test this and so should your output file. Do not use a path name when opening these files. This means the files should be located in the top level folder of the project. This would be the folder that contains the src folder, probably named FileCopy depending on what name you gave the project. Do not use a copy method that is supplied by Java. Your program must read the file line by line and write the file itself. do not write to input.txt* Your class name must be FileCopy. It should be in a package named mypackagearrow_forwardIf you have downloaded the source code from this book’s companion Web site, you will find a file named text.txt in the Chapter 08 folder. Write a program that reads the file’s contents and determines the following:• The number of uppercase letters in the file• The number of lowercase letters in the file• The number of digits in the file• The number of whitespace characters in the filearrow_forwardThe Java class that we use to allow the user to navigate through folders and select a file is called : JFileSelect InFile JFileChooser This is not an option in Java.arrow_forward
- Q3: You're given a folder containing the following files listed and other files. List these files in the folder and rename the first 2 files in this list by removing the first underscom you see in their names. Folder: stu_1_scores_ens306 Folder after renaming: stu1_scores_ens306 stu_1_scores_swe104 stu1_scores_swe104 stu_2_scores_ens306 stu_2_scores_ens306 stu_2_scores_swe104 stu_2_scores_swe104 stu_3_scores_ens306 stu_3_scores_ens306 stu_3_scores_swe104 stu_3_scores_swe104 shopping_list.txt shopping_list.txt research/ research/arrow_forwardusing visual studio and the C# please dont copy the previous answered questions because the solution is incorrect In the Chap07 folder of the Student Sample Programs, you will find a file named ChargeAccounts.txt. The file contains a list of a company’s valid charge account numbers. There are a total of 18 charge account numbers in the file, and each one is a 7-digit number, such as 5658845. Create an application that reads the contents of the file into an array or a List. The application should then let the user enter a charge account number. The program should determine whether the number is valid by searching for it in the array or List that contains the valid charge account numbers. If the number is in the array or List, the program should display a message indicating the number is valid. If the number is not in the array or List, the program should display a message indicating the number is invalidarrow_forwardPython The Springhill Amateur Golf Club has a tournament every weekend. The club president has asked you to write a Menu-Driven program which has the following functionality: 1. Allows for each player's name and golf score to be entered and saved in a text file named golf.txt. 2. Reads each player's name and golf score from the text file golf.txt and provides an average score. 3. The program will use one variable for the player's name and one variable for the score.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License