write a simple shell.
Q: Write a program in Java to perform the following: Using a BufferedReader class and related objects,…
A: below is the java code
Q: In Java, the File class is used to represent the data in a directory entry. Write a program that…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT----------
Q: Create a program that reads three lines from a text file. Each line should be read one at a time.…
A: Please upvote/Like me. please. I am providing you the correct answer below. Please. Please.
Q: Write a program in Python that serves as a password checker. The string password that Python should…
A: Here I have declared the target string and a boolean variable to keep a record that the user enters…
Q: Write a Java program that: Reads a file Counts the number of lines Counts the number of words…
A: Write a Java program that will find the following things: Counts the number of lines Counts the…
Q: IN JAVA Arrange the data for your chart in a text file as follows: The first line of the file is…
A: Define an array (or ArrayList) to store the values of the bars and another one to store the labels.…
Q: Once the modelling has been run, the user should have the option to rerun it. Each time it is run,…
A: One activates some authority: Unless there are connections, I've learned that this just —until…
Q: Write a Java program that will input a file name to be opened for reading. The java file must only…
A: import java.io.IOException; // handles exceptionsimport java.nio.file.Files; // to read…
Q: Design and implement an application that plays the Rock-PaperScissors game against the computer.…
A: Define a list of options: rock, paper, scissors Define a dictionary with the winning combinations:…
Q: xt file of names, (3 names per line, 5 lines in total) followed by an age for each name. Go through…
A: input.txt Smith 25 kevin 65 Hank 54Tom 98 Ben 96 Denver 63John 52 Gandia 63 Tokeyo 29Lebaon 36…
Q: Using switch statements, build a Java class file to calculate the area of a figure (call it…
A: logic:- read user’s choice. Pass user’s choice within switch define three cases circle, square…
Q: In Java Suppose you are given a text file that contains the names of people. Every name in the file…
A: 1. Open the input file for reading2. Open the output file for writing3. Initialize an empty array of…
Q: Write a program that reads a stream of integers from a file and writes only the positive numbers to…
A: The program is written in Java. Please check the below step for the source code.
Q: Write a C++ program: Make a class for rectangle which calculates perimeter and area. then write two…
A: Answer: Algorithms: Step1: we have create a Ractangle class which contains the length as l and…
Q: The operators is ( + : " addition process" , -:subtraction process", *:"multiplication process" ,…
A: It has add, sub,multiply, divide, clear, history function to check two numbers can perform or not…
Q: Write a program that asks a user to input a file name and then reads the file and produces output.…
A: NOTE - I have used python programming langauge for code. Here I have taken input from the user and…
Q: Write a Java program that reads in a paragraph of text from a file and prompts the user to enter a…
A: I have provided JAVA CODE along with CODE SCREENSHOT , TXT FILE SCREENSHOT , CODE S CREENSHOT…
Q: Write a JAVA program that will keep track of the purchases made at a store. Assuming that the…
A: Required java code is given below:
Q: ng Files - Student Line Up ify the Student Line Up program described in Programming Challenge 1 es:…
A: Complete C++ code with explanation: #include <iostream> #include <fstream> #include…
Q: Complete the following incomplete program (begin by copy-pasting that into a new program file). The…
A: Algorithm for the code:- 1. Start 2. Create a GraphWin object named win with a width and height of…
Q: Write a C# program that reads a text file and outputs the contains to the screen. The text file…
A: Start. Declare a class named "Program". Define a static method named "Main" that takes an array of…
Q: You are given a file stored in “D” drive named “input.txt” consist of valid email addresses. The…
A: ALGORITHM:- 1. Pass the file location in the File object. 2. Read the file line by line. 3. Keep the…
Q: Write a Java program that asks a user to input a text file name which contains no punctuations reads…
A:
Q: Unix-based operating systems usually include a tool named tail. It displays the last 10 lines of a…
A: Algorithm: Check if the user has provided the file name and the number of lines to print as…
Q: This Python Lab 9 Lab: Write a file copying program. The program asks for the name of the file to…
A: Solution: Given, Write a file copying program. The program asks for the name of the file to…
Q: Write a java program that reads a file named input.txt and writes a file that contains the same…
A: Required java code along with sample output given below:
Q: Python programming language Write a program that asks the user for a number. Write the number…
A: Given: Python programming language Write a program that asks the user for a number. Write the…
Q: Write a program for the following problem. You're given a file that contains a collection of IDs and…
A: ANSWER:-
Q: Modify the Total program so that it shows the average, not the total of the inputs. Total.java 1…
A: Modified Program: A modified “Total” program is as follows, File name: “Total.java” import…
Q: When you compile and run packaged software from an IDE, the execution process can be as easy as…
A: We need to write a Java code for the given scenario. To compile multiple files, we use: javac…
Q: In Java Suppose you are given a text file that contains the names of people. Every name in the file…
A: 1. Define input file name.2. Open file with BufferedReader.3. While there are lines in the file:…
Q: Write a C++ program using classes that readslines from a file until the end of file. The program…
A: Program Approach:- Using header files. Applying the source file name. The file could not be open.…
Q: Java Program ************This program must work in hypergrade and pass all the test…
A: 1. Start2. Initialize a BufferedReader 'reader' to read input from the user.3. Create a String…
Q: Create a Windows program that lets users investigate the knapsack problem. The capacity, sizes, and…
A: I choose python as a programming language for this window program. Here we used a loop and if else…
Q: Write a Java program that reads from a URL and searches for a given word in the URL and creates a…
A: In this question we have to write a Java program that reads from a URL and searches for a given word…
write a simple shell. When the shell starts, the user can input from
the keyboard the path of an executable followed by several arguments. It is safe to assume that
the input supplied by the user is less than 1024 bytes. Your shell will then execute the
When the executed program completes, then the user can run other programs. If the user types
in “quit”, then the program terminates.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- in java Integer cradleQuantity and string friendName are read from input. A FileOutputStream named fileStream is declared and the file named cradle.txt is opened. Then, a PrintWriter named cradleWriter is declared and associated with the file. Write the following to the opened file: "Remember:" "* * * *" cradleQuantity, followed by " cradles for " and friendName Another "* * * *" End each output with a newline. Finally, close the file. Ex: If the input is 12 Dax, then cradle.txt contains: Remember: * * * * 12 cradles for Dax * * * * Note: Data written to a file may be lost if the file is not closed. 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 public class FileOutput { publicstaticvoidmain(String[] args) throwsIOException { Scannerscnr=newScanner(System.in); FileOutputStreamfileStream=null; PrintWritercradleWriter=null; intcradleQuantity; StringfriendName; cradleQuantity=scnr.nextInt(); friendName=scnr.next();…In this assignment, you will create a Java program to search recursively for files in a directory.• The program must take two command line parameters. First parameter is the folder to search for. Thesecond parameter is the filename to look for, which may only be a partial name.• If incorrect number of parameters are given, your program should print an error message and show thecorrect format.• Your program must search recursively in the given directory for the files whose name contains the givenfilename. Once a match is found, your program should print the full path of the file, followed by a newline.• You can implement everything in the main class. You need define a recursive method such as:public static search(File sourceFolder, String filename)For each subfolder in sourceFolder, you recursively call the method to search.• A sample run of the program may look like this://The following command line example searches any file with “Assignment” in its name%java FuAssign7.FuAssignment7…9 from breezypythongui import EasyFrame 10 11 class TemperatureConverter(EasyFrame): 12 ""A termperature conversion program.""" II II II 13 def -_init__(self): "I"Sets up the window and widgets.""" EasyFrame._init_-(self, title = "Temperature Converter") 14 15 II IIII 16 17 18 # Label and field for Celsius self.addLabel(text = "Celsius", 19 20 row = 0, column = 0) 21 self.celsiusField = self.addFloatField(value = 0.0, 22 row = 1, column = Ø, 23 24 precision = 2) 25 # Label and field for Fahrenheit self.addLabel(text = "Fahrenheit", 26 27 28 row = 0, column = 1) 29 self.fahrField = self.addFloatField(value = 32.0, 30 row = 1, 31 column = 1, 32 precision = 2) 33 # Celsius to Fahrenheit button self.addButton(text = ">>>>", 34 35 row = 2, column = 0, command = self.computeFahr) 36 37 38 39 # Fahrenheit to Celsius button 40 self.addButton(text = "<«««", 41 row = 2, column = 1, 42 command = self.computeCelsius) 43 44 # The controller methods def computeFahr(self): "I"Inputs the Celsius…
- In java, create a program that will use a do while loop with a "yes/no" prompt. The program should include user input and output with getters and setters. Once the end of the loop is reached, ask the user if they'd like to do the program again. Answering "Yes" will start the program over again. Answering "No" will end the program. Answering with anything else will be an invalid input. Once the loop begins again, the program should also discard all previous inputs so that there won't be any overlapping. Use Scanner.nextLine();, it will help.Write a Java program that opens a file and counts the whitespace-separated words in that file. You may obtain the name of the input file either from the command line or via prompt and user input. Be sure to clearly document the method chosen. You may test your program using any number of text files; however, you must be sure to test your program using the Sample Text File provided at the end (excerpt.txt). Sample Text File There was nothing so VERY remarkable in that; nor did Alice think it so VERY much out of the way to hear the Rabbit say to itself, `Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually TOOK A WATCH OUT OF ITS WAISTCOAT- POCKET, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to…Challenge 3: Encryption.java and Decryption.java Write an Encryption class that encrypts the contents of a binary file. Your encryption program should work like a filter, reading the contents of one file, modifying the data into a code, and then writing the coded content out to a second file. The second file will be a version of the first file, but written in a secret code. Use a simple encryption technique, such as reading one character at a time, and add 10 to the character code of each character before it is written to the second file. Come up with your own encryption method. Also write a Decryption class that reads the file produced by the Encryption program. The decryption file will use the method that you used and restore the data to its original state, and write it to a new file.
- Applying object oriented programming, do a python program that will determine the required mass of one compound based on three parameters: (1) compound name, (2) liters of solution, and (3) molarity. The input should be in a single text file (input.txt). The required mass should be in a single text file (output.txt). Only two decimal places should be included in the output.txt. Example: *input.txt* compound,liter,molarity NH4Cl, 0.1, 2.5 NaCl, 0.5, 0.25 Na2CO3, 0.75, 1.25 *output.txt* 13.37 7.31 99.36Write a program that queries information from three files(given to you). The first file contains the names and telephone numbers of a group of people. The second file contains the names and Social Security numbers of a group of people. The third file contains the names and annual income of a group of people. The groups of people should overlap. Your program should ask the user for a telephone number and then print the name, Social Security number, and annual income, if it can determine that information. Sample run1: Enter the phone number (7 digits, with a dash): 555-1234 555-1234 is associated with Bob Bob's SSN is 000300021 Bob's salary is 55000 Sample run2: Enter the phone number (7 digits, with a dash): 675-4566 Couldn't find a name associated with that number. Sample run3: Enter the phone number (7 digits, with a dash): 000-2345 000-2345 is associated with John John's SSN is 000000004 John's salary is 65000 python languageUsing Java PrintWriter, write a program that prompts the user for information and saves it to a text file File name is musicians.txt Use this information below: George,Thoroughgood,54321 Ludwig,Van Beethoven,90111 Edward,Van Halen,12345
- Create a Java program that will let the user choose between organisers and volunteers. Then let them choose their work area (For example - California, Las Vegas, Washington DC, New York etc.) Then -1) Sign-up option is for organisers and volunteers to store their information (First Name, Last Name, User Name, E-mail, Phone Number, Password) in a text file. Also, store organizations name and how many times worked before to the organisers and volunteers section respectively. 2) Log in part is for authentication. Let the user input their username and password. If the username and password remain in the text file we've created in the Sign-up section, it will print "User successfully logged in". If there's not, it will print "Invalid Username and Password."NB- It will not use any graphical interface. Just basic java code. For clear exposure, a photo is attached.Write a complete java program that: asks the user for a file name tests whether the file exists and tells the user if it does exist asks 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, 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.This is phython not Java Lab: Write a file copying program. The program asks for the name of the file to copy from (source file) and the name of the file to copy to (destination file). The program opens the source file for reading and the destination file for writing. As the program reads each line from the source file and it writes the line to the destination file. When every line from the source file has been written to the destination file, it close both files and print “Copy is successful.” In the sample run, “add.py” is the source file and “add-copy.py” is the destination file. Note that both “add-copy.py” is identical to “add.py” because “add-copy.py” is a copy of “add.py”. Sample run: Enter file to copy from: add.py Enter file to copy to : add-copy.py Copy is successful. Source file: add.py print("This program adds two numbers") a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) print(f"{a} + {b} = {a+b}") Destination…