Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment is worth 6 points total, partial credit will be given, Purpose o

ID: 3810294 • Letter: T

Question

 This assignment is worth 6 points total, partial credit will be given,   Purpose of this program: To implement windows batch commands     1 - Worth 0.75 points. Using Windows batch Scripting.       - Using Windows terminal command, create a bat file named:        yourLastNameFirstNameInitialPgm4.bat      - Using the NOTEPAD editor, append the following data to your *.bat file         USING SINGLE LINE COMMENTS FOR EACH LINE       ********************************************************************        Author    : Your Name         Course    : OS section. Example OS1, OS2 OS3, OS4        Professor : Michael Robinson         Program # : Program Purpose/Description                     { A brief description of the program }                         Due Date  : MM/DD/YYYY                                              Certification:         I hereby certify that this work is my own and none of it is the work of any other person.                     *********************************************************************/     2 - Worth 1.75 points. Using Windows batch Scripting.       topic: Implement division by 0, with error trapping, using if and label loop commands,         - Using the NOTEPAD editor, append to the *.bat file, all the commands needed so         that when you execute your bat file, it will produce the following:       a) Append your name, current date and time to a NEW file called results.txt      b) Using two variables: FirstNumber and LastNumber, use a label loop.      c) Ask the user to enter the first number.      d) Ask the user to enter the second number.      e) If the user enters the value 66 for the first or the second number, you must         exit the loop immediately, and terminate this section ONLY.      f) If the second number is ZERO inform  the user that you CAN NOT divide by ZERO,         and ask for a correct second number.      g) If the second number is NOT a zero, do the division, display all numbers of          this computation using labels, and add the same to the results.txt file.                   example: 4 divided by 1 = 4     3 - Worth 1.75 points. Windows batch Scripting.      - Using the NOTEPAD editor, append to the *.bat file, all the commands needed so        that when you execute your bat file, this file will produce the following:           a) Use a for loop from 1 to 10.       b) Find the results of calculating each number from (1 to 10 mod 6) + 2.      c) After the for loop ends, display the average for all previous results and         append them to the results.txt file.     4 - Worth 1.75 points. Using Windows teminal mode commands ONLY      - Using the NOTEPAD editor, append to the *.bat file, all the commands needed so        that when you execute your bat file, this file will produce the following:              a) Create a directory called pgm4-       b) Go to folder pgm4      c) Create a file called one.txt      d) Insert into the one.txt file your name using a single line comments      e) Insert into the one.txt file the command that will display your name      f) Insert into the one.txt file the command that will display one empty line 

Explanation / Answer

Create a new file in notepad " yourLastNameFirstNameInitialPgm4.bat" and paste bellow code and open cmd terminal and run this batch file.

::********************************************************************
:: Author : Your Name
:: Course : OS section. Example OS1, OS2 OS3, OS4
:: Professor : Michael Robinson
:: Program # : Program Purpose/Description
:: { A brief description of the program }
::
:: Due Date : MM/DD/YYYY
::   
::
:: Certification:
:: I hereby certify that this work is my own and none of it is the work of any other person.
::   
:: *********************************************************************/

@echo off
::Answer 2
set name=Alice
echo %name% %DATE% %TIME% >> result.txt


set /p num1="Enter 1st number: "
set /p num2="Enter 2nd number: "

::if %num1% == 66 (echo "You sshoud not enter value as 66" exit) else (echo %num1%)
if %num2% == 0 (
echo you CAN NOT divide by ZERO
set /p num2="Enter 2nd number again: "
set /p sum5=%num1% / %num2%
echo %Num1% divided by %num2% is: %sum5%
) else (
set /p sum5=%num1% / %num2%
echo %Num1% divided by %num2% is: %sum5%
)

::Answer 3
@echo off &setlocal
for /L %%i in (1, 1, 10) do (
set /a CAL="(%%i%%6)+2"
set /a TOTAL=TOTAL+CAL
call echo %%CAL%%
  
)
SET /A "AVERAGE=(%TOTAL% / 10)"
ECHO AVERAGE OF RESULTS IS %AVERAGE%
ECHO.
@ECHO AVERAGE OF RESULTS IS %AVERAGE% >> result.txt
)

::answer 4
md pgm4
cd pgm4
echo ::Alice>> one.txt
echo set name=Alice >>one.txt
echo echo %%name%% >>one.txt
echo echo. >>one.txt

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote