
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Create a new Java program in Replit to write a username and password to a binary file
password.bin
jhill and 12345 are used as examples below but you can use any username/password you want.
RUN you program
Click on password.bin in the Files window and you'll see the contents of the file.
Files
Main.java
password.bin ⠀
password.bin x +
1 NULENG jhillNUL NULNUL NUL NULNUL 09
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 2 images

Knowledge Booster
Similar questions
- Write JAVA code please Below is the Txt data IBMInternational Business Machinery1000 35.45 45.21 APPLApple Computer Corporation1200 15.45 36.21SBUXStarbucks Coffee Inc.1000 3.45 5.21FThe Ford Motor Company1000 35.45 15.21 NFLXNetflix Inc.1000 65.45 3 82.31 5arrow_forwardThis is for Java. Please help. Thanksarrow_forwardyou must create the data files with a text tool, such as Notepad exampleThree In the while loop, this program reads fileLoop.txt until all items are read package hasnext; import java.util.Scanner; import java.io.*; // public class Hasnext { public static void main(String[] args) throws IOException { File loopfile = new File("fileLoop.txt"); Scanner getAll = new Scanner( loopfile ); // connect a Scanner to the file int num = 0, square = 0; while(getAll.hasNextInt()) { num = getAll.nextInt(); square = num * num ; System.out.println("The square of " + num + " is " + square); } getAll.close(); } }arrow_forward
- IN JAVA Description A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to a student, based on the average of his or her four test scores. Test Score Letter Grade 90-100 A 80-89 B 70-79 C 60-69 D 0-59 F The student and score data are stored in the given file StudentInfo.txt. Create a class named GradeBook in a file named GradeBook.java. The class GradeBook is required to use a String array to hold the five students’ names, an array of five characters to hold the five students’ letter grades, and five arrays of four doubles each to hold each student’s set of test scores. The class should have methods that return a specific student’s name, average test score, and a letter grade based on the average. The program that demonstrates the class GradeBook is given in the file GradeBookDemo.java. You are required to read and understand the given program, and make the program…arrow_forwardThe Mid-Term Exam: A program to write (below). Note that you must submit and return directly to me with your name and the date included as an upload Canvas (file) submission. Make sure that your name is used as the file name. (You will not get credit if your exam cannot be read.) No notes, books, cells, Internet Search, computer/device, etc., may be used during this exam. Write a Java program that lets the user enter a series of integers with an input range from 2 to 199 (in random order). The user must enter a value of -1, 0, or +1 (a sentinel which must be an integer and not part of the series of numbers) in order to signal the end of the series. • After all the numbers have been entered, the program should display the smallest and largest numbers entered, and not include the sentinel. Note that this must be a Java implementatiọn, and not pseudo-code, etc. You must use a Loop and If-Else constructs as well.arrow_forwardWrite a program to create a file called password.txtRUN the program You should see the password.txt file in the Files windowModify/replace the Main.java program ito created above to write a username and password on separate lines (jhill and 12345 below can use for the username/password to the file password.txarrow_forward
- Ask the user for a filename. Display the oldest car for every manufacturer from that file. If two cars have the same year, compare based on the VIN. i am having trouble getting my code to work I have this code: import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; class Car { String manufacturer; String model; int year; String vin; public Car(String manufacturer, String model, int year, String vin) { this.manufacturer = manufacturer; this.model = model; this.year = year; this.vin = vin; } public String getManufacturer() { return manufacturer; } public void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } public String getVin() { return vin; } public void setVin(String vin) { this.vin = vin; } } public class Demo {…arrow_forward1. Given the following import statements: import java.util.Scanner; import java.util.InputMismatchException; import java.io.File; import java.io.PrintWriter; import java.io.IOException; A. В. С. D. Е. F. All of the above. Which ones will be needed for file input/output? 2. Choose from below the instance field declarations associated with file processing. А. private String fileName; В. private double testScore; с. private PrintWriter outputFile; D. В only. Е. Both A and C. F. А, в, С. Enter a letter for the answer: 3. Code a createFile method that handles input/output exceptions through its header. public void createFile sert throws clause for handing an IO (input/output) exception. { System.out.printf("%nEnter the file name for test scores + " (WARNING: This will erase a pre-existing file!): ") ; fileName = input.nextLine (); //Complete creating outputFile a PrintWriter object for opening a file. }//END setFileName () : final voidarrow_forwardWrite a program (in Java or C++), allowing to: • Create a folder "Main" • Create a file in the folder "File1" Add Read, Write permissions to "File1" Write in "File1" ● ● Read the content of "File1" ● Modify the content of "File1" Remove the Write permission of "File1" Try to write again in "File1" ● A screenshot is needed showing the results of the program execution.arrow_forward
- PLEASE ASK THE USER IF THEY WOULD LIKE TO WRITE INTO THE FILE IF THEY CHOOSE NOT TO DELETE THE FILE, AND WRITE IT INTO THE FILE USING outputStream Write a complete java program that: asks the user for a filename tests whether the file exists and tells the user if it does exist ask the user whether it should be deleted. Either delete or do not delete the file based on the user input. If they don't delete it, ask them if they would like to write to the file If they want to write, ask what they want to write to the file and write it. Make sure to provide plenty of console output dialog specifying what status/actions are taken at each step.arrow_forwardPlease help me with this Create an unbreakable encryption and decryption program using java. Then create a GUI txt file. But use your own ideas. More information is down belowarrow_forwardWrite a java program that Reads text from the user provided file using FileReader Writes output to a file using the FileWriter class Catches IOException using try and catch block and prints a customized error message.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY