Question

In: Computer Science

Ask the user for their name Create a file called "daily.dat" within the home directory Ask...

  1. Ask the user for their name
  2. Create a file called "daily.dat" within the home directory
  3. Ask the user for a line of text that the system should save to the file
  4. Add to the file the line of text entered by the user
  5. Ask the user for a second line of text that the system should save to the file
  6. Append at the end of the file the line of text entered by the user
  7. Create a copy of the file in the directory "backups" within the home directory, renaming the file daily.bu.
  1. Ask the user for their name
  2. Create a file called "daily.dat" within the home directory
  3. Ask the user for a line of text that the system should save to the file
  4. Add to the file the line of text entered by the user
  5. Ask the user for a second line of text that the system should save to the file
  6. Append at the end of the file the line of text entered by the user
  7. Create a copy of the file in the directory "backups" within the home directory, renaming the file daily.bu.


Please show screenshots from the command prompt! Thank you!

Solutions

Expert Solution

Code : This is a Python3 code

Here i am using 'shutil' library to copy file

Make sure that user exist in the Home directory, what you are entering in the input.

and also these should be a directory with name 'backups'.

output from command prompt :


Related Solutions

Script 3: Ask the user for a file's name If the file exists, ask them if...
Script 3: Ask the user for a file's name If the file exists, ask them if they would like to (C)opy, (M)ove, or (D)elete it by choosing C, M, or D If the user chooses C, ask for the destination directory and move it there If the user chooses M, ask for the destination directory and move it there If the user chooses D, delete the file. Ensure that the user enters only C, M, or D, warning them about...
Write a program that creates a file called "data.dat" in the current directory. Prompt the user...
Write a program that creates a file called "data.dat" in the current directory. Prompt the user for five numbers, and write them, one at a time, on both the screen and into the file. Close the file, then open it again for reading only, and display the contents on the screen. Handle error conditions that may occur. Please Need this to be done in PERL. Thanks
File IO Java question • Ask the user to specify the file name to open for...
File IO Java question • Ask the user to specify the file name to open for reading • Get the number of data M (M<= N) he wants to read from file • Read M numbers from the file and store them in an array • Compute the average and display the numbers and average.
Create a small program that contains the following. ask the user to input their name ask...
Create a small program that contains the following. ask the user to input their name ask the user to input three numbers check if their first number is between their second and third numbers
Task 2.5: Write a script that will ask the user for to input a file name...
Task 2.5: Write a script that will ask the user for to input a file name and then create the file and echo to the screen that the file name inputted had been created 1. Open a new file script creafile.sh using vi editor # vi creafile.sh 2. Type the following lines #!/bin/bash echo ‘enter a file name: ‘ read FILENAME touch $FILENAME echo “$FILENAME has been created” 3. Add the execute permission 4. Run the script #./creafile.sh 5. Enter...
c++ In this program ask the user what name they prefer for their file, and make...
c++ In this program ask the user what name they prefer for their file, and make a file, the file name should za file. Get a number from the user and save it into the create file. should be more than 20 number in any order. print out all 20 numbers in a sorted array by using for loop, last print out its total and average. At last create a function in which you will call it from main and...
Linux Use touch to create a file in your working directory called PutFileHere this is a...
Linux Use touch to create a file in your working directory called PutFileHere this is a linux question i acidentally put javascript when i first submitted it
how to create s recursive function, explore that prompts the user to enter a directory name...
how to create s recursive function, explore that prompts the user to enter a directory name and an executable name, and checks that they are both readable and executable (terminating with an error message if not). It then passes the two names to the explore function. this is a part of bash scripting.
You first needs to create a file called “myJS.js” in your project directory. Then, include the...
You first needs to create a file called “myJS.js” in your project directory. Then, include the AngularJS library and myJS.js in the header of the index.html page. Now, you need to define your angular application and a controller in this file such that the controller has the following variables with these initial values: name = "Alex Cool"; faculty= "Faculty of Busienss and IT"; university = {name:"University of Ontario Institute of Technology", url:"http://www.uoit.ca"}; contacts = {email:"[email protected]", phone:"xxx-xxx-xxxx"}; skills = [ {name:...
Using the given file, ask the user for a name, phone number, and email. Display the...
Using the given file, ask the user for a name, phone number, and email. Display the required information. These are the Files that I made: import java.util.Scanner; public class Demo5 { public static void main(String args[]) { Scanner keyboard = new Scanner(System.in); System.out.println("New number creation tool"); System.out.println("Enter name"); String name = keyboard.nextLine(); System.out.println("Enter phone number"); String phoneNumber = keyboard.nextLine(); System.out.println("Enter email"); String email = keyboard.nextLine(); Phone test1 = new SmartPhone(name, phoneNumber, email); System.out.print(test1); System.out.println("Telephone neighbor: " + ((SmartPhone) test1).getTeleponeNeighbor()); }...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT