On question 1-3 can you please answer each script separately. Please Use Perl Scripting
1.
print "Calculating the Circumference of a circle\n";
my $pi = 3.14;
my $radius = 12.5;
my $circumference = 2 * $pi * $radius;
print "The circumference of a circle is " , $circumference;
$perl main.pl Calculating the Circumference of a circle The circumference of a circle is 78.5
2.
my $radius = <STDIN>;
chomp $radius;
print "Entered radius is ", $radius;
my $pi = 3.14;
my $circumference = 2 * $pi * $radius;
print "\nThe circumference of a circle is " ,
$circumference;
12.5
Entered radius is 12.5
The circumference of a circle is 78.5
3.
my $radius = <STDIN>;
chomp $radius;
print "Entered radius is ", $radius;
my $pi = 3.14;
my $circumference = 2 * $pi * $radius;
if ($radius < 0) {
$circumference = 0;
}
print "\nThe circumference of a circle is " , $circumference;
-8
Entered radius is -8
The circumference of a circle is 0
Please do comment for any doubts or modifications!
On question 1-3 can you please answer each script separately. Please Use Perl Scripting 1. write...
Write a Perl program that computes the circumference of a circle. Your program prompts for and accepts a radius from the person running the program. So, if the user enters 12.5 for the radius, she should get the answer about 78.5. Circumference is 2π times the radius (approximately 2 times 3.141592654).
Write a Perl program that prompts a use to input a line of text. If the line of text mentions both John and Smith, the program outputs “FOUND.” Otherwise, it outputs “NOT FOUND.” Write a Perl program that prompts a use to input a line of text. If the line of text has a word that is capitalized but not ALL capitalized, the program outputs “FOUND.” Otherwise, it outputs “NOT FOUND”. For example, if the user enters “Fred,” the program...
Write a Perl program that prompts a use to input a line of text. If the line of text has a word that is capitalized but not ALL capitalized, the program outputs “FOUND.” Otherwise, it outputs “NOT FOUND”. For example, if the user enters “Fred,” the program outputs “FOUND.” But if the user enters “fred” or “FRED,” the program outputs “NOT FOUND.”
In this program, you will write a Perl program to perform simple checks. You must use loops and if statements to complete the task. 1. Given the following numbers 10, 20, 30, 40, 50, 60, 70, 80, Put the numbers in an array and print the array 2. Assume the user will check if his input, using keyboard, is one of the numbers, the program should behavior as follows: a. User input 100 the program prints not found b. User...
Write a PYTHON program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the...
Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program...
1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in); } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...
Write a program that calculates the area and circumference of a circle. It should ask the user first to enter the number of circles n, then reads the radius of each circle and stores it in an array. The program then finds the area and the circumference, as in the following equations, and prints them in a tabular format as shown in the sample output. Area = πr2 , Circumference = 2πr, π = 3.14159 Sample Output: Enter the number...
Hello Sir, I need help with Java. Here is the problem below. Problem 1.Write a program that prompts the user to enter the number of milliseconds and converts the milliseconds to a string hours:minutes:seconds. The program should use the convertMillismethod with the following header: public static String convertMillis(long millis) For example, convertMillis(5500) returns the string 0:0:5, convertMillis(100000) returns the string 0:1:40, and convertMillis(555550000) returns the string 154:19:10. Problem 2. (Count occurrence of numbers)Write a program that reads integers between 1...
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...