## code is explained in comments:
#!/bin/bash
echo "Enter Year:" #print this on the terminal
read yr #store in yr variable
yr=$(( $yr % 4 )) #caluclate remainder by dividing by 4
if [ $yr -eq 0 ] #if it is zero ,then print Its a leap year
then
echo "Its is a Leap Year!"
else
echo "Its is not a Leap Year!" #Else print as not a leap year
fi #end of if loop
//output:
//False case :

4) Write a shell script to find whether a year was leap year or not. The...
solve in python In the planet Utopia a year is a leap year in this century and previous century between years 45 and 450, if it is divisible by 30, Write a program that calculates whether a given year is a leap year in UTOPIA. Input: The year in 4 digits between 45 and 450. You need to check the input year. When the input year is less than 45 or greater than 450 then use a loop to generate...
Write a shell script that given a radius, calculates the area of a circle. (Hint – don’t write this from scratch. Find another script that reads user input and performs a calculation, then modify it to meet your needs.) Save the script in your home directory with the name circle.sh The formula for calculating the area is: Area=Π*Radius2 You can use 3.14 for Π, and either do Radius*Radius or Radius^2 to get the square of the radius. Use the scale...
FINDING THE LEAP YEARS (14 points) From Wikipedia, "A leap year (also known as an intercalary year or bissextile year) is a calendar year containing one additional day (or, in the case of lunisolar calendars, a month) added to keep the calendar year synchronized with the astronomical or seasonal year." In the Gregorian calendar, which is in use today, to determine leap year: A year is a leap year if it is divisible by 400 Or it is divisible by...
Write a script in matlab that prompts the user to input the day, month, and year; determine the day of the year (the number of days including the current day). Be sure to take leap year into account. Use a for loop Test your code on the following dates: February 28, 2015 April 9, 1976 October 12, 1887 Create a script that performs the same function as repmat. The only built-in commands you may use are input, size, and disp.
PLEASE WRITE CODE FOR C++ ! Time Validation, Leap Year and Money Growth PartA: Validate Day and Time Write a program that reads a values for hour and minute from the input test file timeData.txt . The data read for valid hour and valid minute entries. Assume you are working with a 24 hour time format. Your program should use functions called validateHour and validateMinutes. Below is a sample of the format to use for your output file timeValidation.txt : ...
#1 Write a MATLAB script to solve: Leap Year Program (practice your IF statements!) Write a code to determine if a year is considered a leap year or not? Display to the screen if the year is a leap year or not. Use num2str() and display() or fprintf(). In the Gregorian calendar three criteria must be taken into account to identify leap years: The year is evenly divisible by 4 (Exceptions 1700, 1800, and 1900); If the year can be...
Write a program that accepts a year and determines whether the year is a leap year. Use the mod function. The output should be the variable extra_day, which should be 1 if the year is a leap year and 0 otherwise. The rules for determining leap years in the Gregorian calendar are as follows: All years evenly divisible by 400 are leap years. Years evenly divisible by 100 but not by 400 are not leap years. Years divisible by 4...
SHELL SCRIPT: Provide the following questions with the codes and command line Problem 5: Take 5 input arguments in a for loop, but only add the even i values to sum and display the result. Problem 6: Write a shell script that accepts path of the directory and returns a count of all the files within the specified directory. (Hint: use alias to perform cd operation) Problem 7: Write a shell script that takes an ‘count’ value as an input...
Please write a bash script for the following two questions, thank you. Write a shell script “6-1.sh” to calculate the exponentiation using while loop. This script needs to take two inputs like “6-1.sh a b”, and outputs the result of “ab”. Note: You need to implement it, DO NOT use the exponentiation operation provided by the Linux. Write a shell script “6-2.sh” to calculate the factorial of a number using while loop. This script needs to take one input...
Write a script using the bash shell to add new users to the system. The script should read user information from a comma-delimited file (each field should be separated by a comma). The filename should be passed to the script as a command-line argument. Be sure the script contains a usage clause. The input file should contain the user information with one user per line. As the system administrator, you should determine the information necessary for each user to properly...