Question

3. Write a script (name it /opt/book/ scripting /results/exercise3) which: a. Asks the user for the...

3. Write a script (name it /opt/book/ scripting /results/exercise3) which:

a. Asks the user for the length and width (in feet) of a rectangular room

b. Calculates the area of the room

c. Displays the result to the user [Show the ouput via screenshot]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note : You haven't mentioned the script name so i did that question in JavaScript.

I hope this will help for you.

<html>
<head><title>Area of the room</title>
</head>
<body>
<script language="javascript">

var length,width,area;
length=parseFloat(prompt("Enter the length in feet : "));
width=parseFloat(prompt("Enter the width in feet : "));

area=length*width;

document.write("<br>Length : "+length+"<br><br>");
document.write("Width : "+width+"<br><br>");
document.write("Area of the room : "+area+" Square Feet!!");

</script>
</body>
</html>

Add a comment
Know the answer?
Add Answer to:
3. Write a script (name it /opt/book/ scripting /results/exercise3) which: a. Asks the user for the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • matlab The Homework should be submitted as a script (.m) file Write a script areaMenu that...

    matlab The Homework should be submitted as a script (.m) file Write a script areaMenu that will print a menu consisting of "Cylinder," "Circle," and "Rectangle." It waits for the user to choose from the menu then call the corresponding function of each choice as follows: 1- Cylinder will call the function (cyl) which prompts the user for the radius and height of the cylinder, then calculates and prints area of the cylinder. 2- Circle will call the function (cir)...

  • In Matlab, write a script which asks a user to input numbers until the user inputs...

    In Matlab, write a script which asks a user to input numbers until the user inputs 0. Then the script should print only the positive numbers entered by the user, in reverse order. For example, if the user inputs “4,-1,5,2,-3,-8,0” the script should print “2,5,4”.

  • Write a script which asks the user to input numbers until the user inputs 0. Then...

    Write a script which asks the user to input numbers until the user inputs 0. Then the script should print only the positive numbers entered by the user, in reverse order E.G. if the user inputs '4, -1, 5, 2, -3, -8, 0', the script should print '2, 5, 4'. Please don't copy someone else's answer as they don't work.

  • Write a MATLAB script, which asks the user to input the angle xd (in deg) and...

    Write a MATLAB script, which asks the user to input the angle xd (in deg) and then approximates sine of the angle using the first 5 terms of Taylor series as follows: n+12n-1 sin n-1 (2n-1)! 1 Note that x in Taylor's equation is in radian, so make sure to do the conversion first Start with defining the vector n=1:5 and then use element-wise operation and basic MATLAB commands to calculate the summation. To calculate the factorial of any number,...

  • CENGAGE MINDTAP gramming Exercise 3-8 PaintCalculator.java Instructions Assume that a gallon of paint covers about 350...

    CENGAGE MINDTAP gramming Exercise 3-8 PaintCalculator.java Instructions Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompts the user for the length, width, and height of a rectangular room. Pass these three values to a method that does the following: 1 import java.util.Scanner; 2 public class PaintCalculator { 3 public static void main(String args[]) { // Write your code here public static double computeArea double length, double...

  • Task 3 [35 marks] Write a MIPS program that does the following (in a correct, user-friendly...

    Task 3 [35 marks] Write a MIPS program that does the following (in a correct, user-friendly way):  Greets the user, states the purpose of the program  Sequentially asks the user to provide integer coefficients A,B,C  Calculates discriminant D of quadratic polynomial. (Hint: D = B2 – 4×A×C)  Displays the calculated D value  Checks (in this order) whether discriminant is: o D = 0? Then, displays: “Quadratic polynomial has a sole root.” o D > 0?...

  • USE C Programming LANGUAGE ONLY PLEASE. We use <stdio.h> if that helps. For the following problems,...

    USE C Programming LANGUAGE ONLY PLEASE. We use <stdio.h> if that helps. For the following problems, create the prototype function, calling function “int main()”, and function. So the function prototype, function call, and function header/body should be seen in the answer. The processor directive is not needed. Show a sample call from the int main() function for all problems. If you can for the first one please show proof that it has no errors. 1. Write a function called DisplayColumbiaUniversity...

  • Room Class....... in JAVA!!!!! Write a class named Room that has the following fields: Length: Double...

    Room Class....... in JAVA!!!!! Write a class named Room that has the following fields: Length: Double variable that holds the rooms length(in feet). Breadth: The double variable that holds the rooms breadth(in feet). Height: Double variable that holds rooms height in feet. Color: String object that holds the color you want the room to be painted with. The class should have a constructor to initialize the fields for a particular instance (or object) of the class as given: All double...

  • Using C++ cs 102 REVIEW LAB Selection a) Minimum/Maximum: Nrite a program that asks the user...

    Using C++ cs 102 REVIEW LAB Selection a) Minimum/Maximum: Nrite a program that asks the user to enter two numbers. The progzan should use the conditional operator to determine which number is the smaller and which is the larger. Display your output in the format below: The smaller number is: (smallerNumber) The larger number is: ClargerNumber] b) Areas of Rectangles: The area of a rectangle is calculated by maltiplying its length tines its width. Write a program that asks the...

  • 2) Write a program in C/C++ that asks the user to enter a number then the...

    2) Write a program in C/C++ that asks the user to enter a number then the user's input value is passed to a function which increments the number by 10 and returns the result of the incrementation. Write the program to accomplish the increment using three (3) different techniques. To test each technique separately, the user should enter a different number for each of the three (3) techniques. Make sure that you compile and execute your program. Finally, provide screenshots...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT