1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MissTica
3 years ago
7

Write a program to compute answers to some basic geometry formulas. The program prompts the user to input a length (in centimete

rs) specified as a floating point value. The program then echoes the input and computes areas of squares and circles and the volume of a cube. For the squares, you will assume that the input length value is the length of a side. For the circles, this same value becomes the diameter. Use the meter value input to calculate the results in square (or cubic) meters and then print the answers in square (or cubic) meters.
Computers and Technology
1 answer:
Svetlanka [38]3 years ago
4 0

Answer:

import math

l = float(input("Enter length in cm: "))

l = l / 100;

print("Entered length is " + str(l) + " meters")

area_square = l * l

print("Area of square is " + str(area_square))

area_circle =  math.pi * l/2 * l/2

print("Area of circle is " + str(area_circle))

volume_cube =  l * l * l

print("Volume of cube is " + str(volume_cube))

Explanation:

*The code is in Python

Ask the user to enter the length in cm

Convert the length to meters and print it

Calculate the area of the square and print it (Since length is equal to a side, the area is length * length)

Calculate the area of the circle and print it (Since length is equal to the diameter, you need to divide it by two to get the radius. The area is pi * length/2 * length/2)

Calculate the volume of the cube and print it (Since length is equal to a side, the volume is length * length * length)

You might be interested in
Lots of Ways to Use Math.random() in JavaScript
Alja [10]

Math.random() is a built-in function in JavaScript that generates a random number between 0 and 1.

<h3>What is Math.random()?</h3>

Math.random() is a useful and versatile function that can add a element of randomness to your JavaScript programs.

This function can be used in a variety of ways in JavaScript programs, such as:

  1. Generating random numbers for games or simulations.
  2. Creating random samples for statistical analysis.
  3. Shuffling elements in an array for a random order.
  4. Selecting random items from a list for a quiz or survey.
  5. Creating unique IDs or keys for objects in a database.

To Know More About built-in function, Check Out

brainly.com/question/29796505

#SPJ4

8 0
1 year ago
In some video games, the player cannot obtain the reward without doing what with something that they already have?
Crank

Answer:

risking

Explanation:

8 0
2 years ago
What to do when microsoft word is eating your words?
Aloiza [94]
Update it so it wont do that
4 0
3 years ago
Select the correct answer.
Andrei [34K]

Answer: The answer is C

Explanation: When it comes to research papers your topic shouldnt be too broad. Your topic should be broad enough you can find a good amount of information but not too focused that you can't find any information.

7 0
2 years ago
.Suppose some functions have been entered into a local file named "weather.js". Write the correct SCRIPT tag to load the library
Doss [256]

Answer:

<script type="text/javascript" src="weather.js"></script>

Explanation:

we have to use above script tag to include weather.js file into our web page.

Here type attribute represents the type of the file which we are trying to include on the web page.src attribute represents the path of the file from where we want to include that into our web page.

Generally we can include our java script functions into web page in 2 ways. one is inline function we can write the code in web page <script> tag itself .another way is to write the code in a separate file as shown above and include it in the webpage

5 0
3 years ago
Other questions:
  • What economic measure is at the highest level since the Great Depression?
    12·1 answer
  • Catherine wants to search online for fruit juices. She is fine with aerated or fresh fruit juices. Which Boolean operator will e
    12·2 answers
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • Fortnite anyone? i just started tdy so dont be judgiee lol
    6·2 answers
  • What is a boolean in Java
    5·1 answer
  • In order for bitlocker to protect the system volume without the aid of an external drive, your computer must:
    12·2 answers
  • The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets t
    5·1 answer
  • An eReader has a 956-pixel x 1290-pixel grayscale display with each pixel able to display 32 shades of gray. What is the KiB siz
    9·1 answer
  • Jon wants to assign a value to the favorite food variable: favoriteFood! = "Pizza" but gets an error message. What does he need
    9·2 answers
  • Write a method for the Invitation class that accepts a parameter and uses it to update the address for the event.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!