Consider the values of a=5 and b=25 and give the output of the below script: 'a=$a+$b' let "b=$a+$b" let "c=$a+$b" 3 let 4 6. let "d=$a+$b+$c" 7 echo "value of d is $d" value of d is
Q: Write a shell script with a while loop that keeps on accepting a string and outputs the string till…
A: #infinite while loop to read input and display while [ 1 ]do echo "Enter the string" read str…
Q: In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of…
A: ALGORITHM / STEPS: Initialising the bill variable with 47.28 Finding the tip (i.e 15% of the…
Q: Q1. Write an mfile that enter a value x using input command. If x is greater than or equal to zero,…
A: Below is the complete solution with explanation in detail for the given question.
Q: Write a script to input five numbers from user and calculate the product and average according to…
A: The echo function is used to display the message on console. The read function is used to input the…
Q: Answer the following question using MATLAB la: Write a MATLAB command that calculates 2° – 24 4 62…
A: Bijaya ka account gya rundi khaane . Bijaya bhosadiwala
Q: In the command: print("Group: %2d" %(2)), what is thed inside the quotes used for? а. To format the…
A: Given :
Q: which variables are visible and what are their values at point assuming dynamic scoping. whats…
A: Answer:
Q: Which of the following is a FALSE statement? O High level languages are easy to understand O Python…
A: An equivalent program in a high-level language can be less efficient and use more memory. so third…
Q: Consider the following DFA. Which input string can be accepted? 0,1 1 0,1 91 92 93 O 1001 01 O 0001…
A: Given: Choose the correct option.
Q: 3. Which of the following are equivalent to Vr : P(x) ^ Q(x)? a. ¬3x : ¬P(x) v ¬Q(x) b. Væ : ¬P(x) =…
A: According to the formula For all x: P(x) and Q(x) is equal to there doesn't exist x, not P(x) or not…
Q: Which of the following is the same ass [0 : -1] ?a) s [-1] b) s [ :] c) s [ : len(s) -1] d) s [O :…
A: Lets see the solution.
Q: Write a script to evaluate the expressions given below: ΠΖ лу 3 − ) + sin ( - ) 2 b.2cos (30°x) +√5…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: Write a shell script to ask for a student name and percentage score as an input and provide the…
A: Write a shell script to ask for a student name and percentage score as an input and provide the…
Q: what is an alternative to backquotes (as in blah= wc -c hello.c) in bash. a. The dollar notation (as…
A: Below is the answer with reason :
Q: Consider the following script: x = 0:0.1:2; for i - 1:length (x) y (i) = sin (2*pi*x(i)) *exp(-0.5*x…
A: The solution to the given problem is below.
Q: *.The output of the following script is 27-34 void smal (int x);int main () { int x = 13; smal (x);…
A: As per the answering guidelines solving the first question completely.
Q: Which of the following will not provide a valid output? Group of answer choices float(2.3e2)…
A:
Q: Enter an integer n from the keyboard 1. Check if n is divisible by 3 then print the content "n is a…
A: The code for given problem is solved using C programming language below. Algorithm: The algorithm…
Q: Philippine currency is broken down into 1000, 500, 100, 50, 20, 10, 5 and 1 peso coin. Write a PHP…
A: PHP code is given below
Q: (A) Write a program in a script file to solve these three equations using the command (solve). Make…
A: For script A. Read the value of x1 x2 x3 and x4. Then solve the three equation for the value of x1…
Q: Write a shell script program to calculate the net pay (monthly salary) of an employee who works in…
A: GIVEN: Write a shell script program to calculate the net pay (monthly salary) of an employee who…
Q: Which is the correct syntax for converting the following expression into C language? Va + a? k a.…
A: Correct Option: a. K=(sqrt(a) + pow(x,2))/b
Q: Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text…
A: Step 1: Prompt and accept the string and the distance. Step 2: Iterate through the characters in…
Q: (4) Assume the following code is executed, how many message boxes will there be? What will be…
A: The above question consists of a VB code implementation where the given snippet is the…
Q: The value of Y after executing the program, n-6.x=2 is: Private Sub Command1 Click () Dim X, n, Y as…
A: SUMMARY: - hence we discussed all the points.
Q: Enter an integer n from the keyboard 1. Check if n is divisible by 3 then print the content "n is a…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Write a script that will ask the user to enter a number that is greater than 0. Then the script must…
A: Python program for above : import random # get a number from user num = int(input("Enter a…
Q: Write a script which prompts the user to enter a date (day and month as integers) of the Gregorian…
A: NOTE - I have used the Python programming language. I have created a function named validateDay(),…
Q: Q3: a) Write a MATILAB program to read the value of (x), then: i. Chcck if x is integer and between…
A: We need to write Matlab code for given functions.
Q: 9) Write a script to evaluate the value ofT according to the following conditions: T=200 when y is…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: Let's say you initialize x as "uint32_t x = 0x0000FFFF;". What is the value of (x << 1)?
A: 1) initial value of uint32_t x = 0x0000FFFF 2) Now in expression (x << 1) we are shifting…
Q: Write the value of Y after executing (i ) the following program, where R=12, T-7 Private Sub…
A: Lets Dry Run The Given Program program, where R=12, T=7 Private Sub Command1 Click () Dim R, T Y As…
Q: Write a shell script which takes an input (an integer smaller than 10,000) from users and displays…
A: Answer
Q: The value of Y after executing the program, n-6 .x-2 is: Private Sub Command1 Click () Dim X, n, Y…
A: The values of n and x are given in the question. Thus, the value of y can be easily calculated by a…
Q: Write a Python script to enter 100 degrees then calculate and print the percentage of the degrees…
A: degrees = []count=0for i in range(0,100): x=int(input("Enter the degree: ")) if(x > 60 and…
Q: Reads in the coordinates of two points, computes the slope of the line through the two points, and…
A: Slope of line is given by formula m=(y2-y1)/(x2-x1) The slope is infinite if (x2-x1) is 0 The slope…
Q: Given the law of sines a = sinB bsinA for a triangle; write a script that requests for user input on…
A: Code: b=input('Enter b: ')A=input('Enter A: ')B=input('Enter B: ')…
Q: Show L = {w|w is in {0, 1, 2}* with no(w) > n:(w) and no(w) 2 n2(w), where no(w) is the number of Os…
A: Given language is L={w | w is in {0,1,2}* with n0(w)> n1(w) and n0(w)>= n2(w), where n0(w) is…
Q: Write a script that will accept the sides of a triangle, let them be “a”, “b”, “c”. Based on these…
A: We need to write a script that reads 3 sides of a triangle. Then it prints by calculating whether…
Q: 3. Write a script that will accept the sides of a triangle, let it be “a”, “b”, “c”. Based on these…
A: BeginDeclare three variable a,b and cTake input from user for a,b and cif square of c is equal to…
Q: In the command: print("Group: %2d" %(2)), what is the d inside the quotes used for? a. To format the…
A: %d is used to Format the output as a decimal Integer
Q: Assume x value as x=15 and y value as y=26, give the output of below given script: 1 if [ $x -gt $y…
A: 1) We have value of x = 15 and value of y = 26. Lets evaluate the script Line 1 checks if value of…
Q: Write a shell script to read length and width of rectangle and compute the area of rectangle by…
A: In shell script programming language in UNIX operating system, each value is considered as a string.…
Q: Create a script called "squarefootage.sh" that takes two random numbers (parameters] provided by the…
A:
Q: Which is the correct syntax for converting the following expression into C language? a.…
A: The correct option is "b" i.e., k=(sqrt(a)+pow(x,2))/b.
Q: document.getElementById
A: Given :- The java script code is mention in the above given question Need to make the java script…
Q: PYTHON!!!!! Write a script that inputs a line of plaintext and a distance value and outputs an…
A: The, code has given below:
Q: What is the output of the given Python script? a,b= 'salalah','muscat' a,b=b,a print(a,b) a. muscat…
A: d) muscat salalah
Step by step
Solved in 2 steps with 1 images
- Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher. The script should work for any printable characters. An example of the program input and output is shown below: Enter a message: Hello world! Enter the distance value: 4 Result: Lipps${svph% This is my code but the result is not the same as what it is supposed to be. code = input("enter coded text: ") distance = int(input("enter value: ")) plainText = "" for ch in code: ordvalue = ord(ch) ciphervalue = ordvalue - distance if ciphervalue < ord('a'): ciphervalue = ord('z') - \ (distance - (ord('a')-ordvalue - 1)) plainText += chr(ciphervalue) print(plainText) enter coded text: Hello world!enter value: 4result: ahhk¶sknhrµWrite a script to find and print current day and time import time now = time.localtime() print(time.strftime("%m/%d/%Y %I:%M:%S %p", now)) Add code which prints a greeting, either "good morning", "good afternoon", "or good evening", depending on the current time.You are given a formula where pressure (P) is related to temperature (T), P=15*T with pressure in units of J/m3 and temperature in Kelvin. Use Excel to first list a range of temperatures between 0-50 Celsius in 5 degree increments. (input into a worksheet T(C) in B1, 0 in B2, 5 in B3, 10 in B4, etc. until 50 in B12). Then convert those temperatures to Kelvin in the next column (C1 should be T(K), C2 to C12 should be the temperature range in Kelvin). Temperature (in Kelvin) = Temperature (in Celsius) + 273.15. The next column (D) should then be labeled in P( J/m3 ) in D1, followed by the pressure value for each relative temperature (the pressure value in D5 should be the pressure at the temperature of C5). Based on the formula of P = 15*T with pressure in units of J/m3 and temperature in Kelvin, what is the value of pressure found in D7?
- Write a shell script which takes an input (an integer smaller than 10,000) from users and displays each digit of the integer one by one. For example, if you input “153”, the shell script will identify and display “1”, “5” and “3” on the screen sequentially. If you input “69”, it will display “6” and “9”. (Hint: you may use % operator)Using netbeans, make a program that converts years to days, weeks, hours, minutes, and second. Assume that 1 year is 365 days. The output must look like the picture shown below.Using the provided secret_num.csh finish the script by accepting an integer as input and evaluating whether it is higher or lower than the generated random number. The script will continue to run until the user guesses the correct random number, at that point the script will terminate. #!/bin/tcsh #Your Name #secret_num.sh set secret=`shuf -i1-100 -n1` echo "Guess my secret number from 1 to 100" while ( 1 ) #Your script goes here echo -n "Your Guess?: " #Your script goes here end
- Write a shell script program to calculate the net pay (monthly salary) of an employee who works in an IT company called Centrum Software’s, Toronto, considering the allowances (TA, DA, HRA) and deductions (Harmonized sales tax – HST) , (Retail Sales tax- RST). Give the basic pay as user defined input. Net pay calculation: Salary = Basic pay + Allowances – (Taxes, Deductions) TA = 15% of basic pay DA = 2% of basic pay HRA = 10% of basic pay HST = 10% RST = 5% LinuxThe output of the code is not what's shown in the above figure with the question. What's another way to write the script ?Start up an interactive Python session and try typing in each of the following commands. Write down the results you see.a) print ("Hello, world! ")b) print("Hello", "world!")c) print (3)d) print(3.0)e) print (2 + 3)f) print(2. 0 + 3. 0)g) print ( II 2 II + II 3 II )h) print ( "2 + 3 =", 2 + 3)i) print(2 * 3)j) print (2 ** 3)k) print (7 I 3)1) print(?// 3)
- Write a shell script to check if a number is even or odd, if number is even calculate factorial of a number n otherwise find value of z, where z=1/2+2/3+3/4+.............+n/n+1. [Factorial of a number example: 5!=5*4*3*2*1]Trace the code below in detail. What is going to be done? What is the order of Lines L1,L2,L3,L4 ouput on the screen? (echo is the command to write the parameter (ex: echo merhaba writes merhaba on screen) (Suppose that value_1 = 3, value_2=5, value_3=2)| int main(int argc, char *argv[] ){| pid_t pid, w;| int status, tim;| srand((unsigned) getpid());| if ( argc < 4 ) {L1| cerr << "Usage " << *argv << " value_1 value_2 value_3\n";| return 1;| }| for (int i = 1; i < 4; ++i)| if ((pid = fork( )) == 0)| {| tim = int (rand() %5);L2| execl("echo", "echo", tim, (char *) 0);| alarm(tim);| sleep(4);L3| cout << “After ” << tim << “second return to child” << endl;| }| elseL4| cout << "Forked child " << pid << endl;|| while ((w=wait(&status)) && w != -1)| cout << "Wait on PID: " << dec << w << " returns status of "| << setw(4) << setfill('0') << hex| <<…Write a Python script that reads the user's year of birth, then display their age along with one of the following messages: if the user is less than 18, print "You're still a baby". If the user is between 18 and 27 years of age, print "Welcome to being responsible". If the user is between 28 and 45 years of age, print "Now you know what life is really all about". If the user is between 46 and 85 years of age, print "Still having fun?". If the user is older than 85, print "Congratulations, you outgrew most humans". If the age comes out to be a negative number, print "That's not possible. Try again".