USING WINDOWS BATCH SCRIPTING
topic: Implement division by 0, with error trapping, using if and sumilating while loops -
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 and class name and section.
b) Using two variables: FirstNumber and SecondNumber,
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 22 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, example: 4 divided by 1 = 4
Code:
divide.bat:
@echo off
::this will prevent each line to output on cmd
::take 1st number into FirstNumber variable and /p allows you
take user input here
set /p FirstNumber=Enter 1st number :
::as required if FirstNumber is se to 22 it will terminate using
exit /b and 0 indicates program executed successfully
if %FirstNumber%==22 exit /B 0
::while loop start's here hence lable
:while
::take 2nd number into SecondNumber variable and /p allows you take
user input here
set /p SecondNumber=Enter 2nd number :
::as required if FirstNumber is se to 22 it will terminate using
exit /b and 0 indicates program executed successfully
if %SecondNumber%==22 exit /B 0
::if SecondNumber is equal to 0 then prompt and go to while
lable above
if %SecondNumber%==0 (
echo You cannot divide by zero
goto :while
)
::perform division and store in ans variable
set /A ans=%FirstNumber%/%SecondNumber%
::Output final ans
echo %FirstNumber% divided by %SecondNumber% = %ans%
Screenshot:

Output:

USING WINDOWS BATCH SCRIPTING topic: Implement division by 0, with error trapping, using if and sumilating...
Create a Windows batch script. The batch script will contain the following: Ask the user interactively: Boot drive letter of the computer Computer name Computer Model Check to see if the boot drive in #1 exists with the folder newfolder (#1 above) If yes cd BootDrive\newfolder If no, make the directory BootDrive\newfolder Check to see if casefile.txt exists: If yes goto the label DONE Tell the user that data already exists in the newfolder folder and exit the program Output...
Using Kali Linux, the Windows Linux Sub-System, or another Debian based Linux distribution, perform the following tasks based on the Linux Fundamentals lecture. For this lab, take screenshots for all major steps completed to illustrate that each task was successfully completed the same method as would be used for other labs). Tasks: 1. Create a new user named Billy Bob using the command linter face 2. Add Billy Bob to the sudoers group 3. Update and upgrade your Linux distribution...
Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a file called Numbers.txt in your the same folder as your Python program. This file should contain a list on floating point numbers, one on each line. The number should be greater than zero but less than one million. Your program should read the following and display: The number of numbers in the file (i.e. count them) (counter) The maximum number in the file (maximum)...
Mini Project You are required to do this assignment on your own skills. No copying from other students are not allowed. Write a menu driven Bash script using the guidelines given below. Some of the commands and syntax may not be covered in lectures. Please refer other sources to understand syntax and commands you need to complete this assignment. This program takes user input and to perform simple arithmetic operations such as addition, subtraction, multiplication and division of any two...
This will be done using Python in Linux Mint. The program should include a comment block at the top with your name, the program number, and the name of the course. (Make sure to have the file that does have the extension .py) How to run the file in Linux Mint? Open a command prompt (e.g. terminal) Make sure you are in the directory where your file is saved (e.g. type "cd ~/Desktop" if your file is on...
need help with this assignment, please. Part 1 - Java program named MemoryCalculator In your Ubuntu VM (virtual machine), using terminal mode ONLY, do the following: Create the folder program2 In this folder place the text file located on my faculty website in Module 2 called RAMerrors (Do not rename this file, it has no extension.) It is down below. Ths is the file RAMErrors 3CDAEFFAD ABCDEFABC 7A0EDF301 1A00D0000 Each record in this file represents the location of an error...
Java: student directory GUI You need to implement three classes: Person Student StudentDirectory StudentMain Start by implementing Person and Student classes. Once you are sure you can serialize and deserialize and ArrayList of Students to and from a file, move on to building the GUI application. Person: The Person class should implement serializable interface. It contains the following: Person's first name (String) Person's last name (String) Person's id number Person's date of birth (Date) public String toString(): This method method...
Program in C++
Implement Conway's Game of Life using 2-dimensional arrays. All the tips, tricks, techniques we have been using in class are allowed. Nothing else. The program should read the initial state of the board by reading in "alive" cells from a user input data file. Meaning your program should ask the user the name of the data file. Assume all the other cells are "dead." Make sure to use modular coding techniques. The main program should be pretty...
Python 3.7 Students Grade This project will have you using error handling and file handling to display mid semester report with percentage of student work and their grade. The ‘Students.csv’ file contains students name, exam1 score, exam 2 score, assignment 1 and assignment 2 scores as well. All tasks are out of 100 each. The ‘Students’ are .csv, you may find using the csv module easier to use. However, you can always read in a line and use. split. Requirements...