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
anzhelika [568]
3 years ago
12

Create a program called "Geometry" Prompt the user for a small decimal number. Prompt the user for a large decimal number. Using

those numbers as lower and upper bounds, randomly generate a decimal value between the two. Using the randomly generated number, calculate the VOLUME of a sphere if it were to have that size radius. Output the radius as well as the volume back to the user.
Computers and Technology
1 answer:
skelet666 [1.2K]3 years ago
8 0

Answer:

In Python:

import random

small = float(input("Small: "))

large = float(input("Large: "))

radius = round(random.uniform(small, large),2)

volume = round(4/3 * 22/7 * radius* radius* radius,2)

print("Radius: "+str(radius))

print("Volume: "+str(volume))

Explanation:

This imports the random module

import random

The next two lunes prompt the user for small and large decimal number

small = float(input("Small: "))

large = float(input("Large: "))

This generates the radius

radius = round(random.uniform(small, large),2)

This calculates the volume

volume = round(4/3 * 22/7 * radius* radius* radius,2)

This prints the generated radius

print("Radius: "+str(radius))

This prints the calculated volume

print("Volume: "+str(volume))

<em>Note that, the radius and the volume were approximated to 2 decimal places. Though, it wasn't stated as part of the program requirement; but it is a good practice.</em>

You might be interested in
That agreement received after completing it to your program at a community college is called a
Zanzabum

Answer :  Articulation Agreement.

Explanation :

Articulation is a general contract between some colleges and universities which allows a student to easily go to another university for more education. It is a formal agreement between two parties documenting the transfer policies for some specific programs or academic courses.

The articulation agreement is given only when the program is completed at the community college with good behaviour and academic record. The argument documents a pathway between two colleges or universities and their academic programs.

3 0
3 years ago
A firewall can consist of all devices positioned on the network _____________.
ale4655 [162]

Answer:

The answer to this question is "perimeter".

Explanation:

In computer science, the firewall is used to provide a network security system that manages network traffic like incoming and outgoing signals. This traffics is based on predetermined security rules. The firewall typically installs a boundary between a trusted inner network and an untrusted outer network, such as the Internet. It is a software concept and Perimeter firewalls manage the flow of network traffic and host or organization's border the boundary that provides the first line of security against outer attacks and blocking access to inappropriate content from inside an organization.

6 0
4 years ago
OO<br>(A) 3 and 5<br>(B) 4 and 8<br>(C) 2 and 0<br>(D) 6 and 9<br>2. There are twelve books on a shelf and four children in a ro
dlinn [17]

Explanation:

2.there will be 8 books left on the shelf if each child takes one

8 0
3 years ago
Windows pe includes networking components and allows you to use current windows drivers for network connectivity.
4vir4ik [10]
Indeed it is very true
4 0
3 years ago
Write a program that accepts a number as input, and prints just the decimal portion.
Olegator [25]

<u>Answer:</u>

<em>There are 2 ways to do extract the decimal part: </em>

<u>Explanation:</u>

  • <em>First method using number  </em>

<em>int main() { </em>

<em>  double num = 23.345; </em>

<em>  int intpart = (int)num; </em>

<em>  double decpart = num - intpart; </em>

<em>  printf(""Num = %f, intpart = %d, decpart = %f\n"", num, intpart, decpart); </em>

<em>} </em>

  • <em>Second method using string: </em>

<em>#include <stdlib.h> </em>

<em>int main() </em>

<em>{ </em>

<em>    char* inStr = ""123.4567"";          </em>

<em>    char* endptr;                       </em>

<em>    char* loc = strchr(inStr, '.'); </em>

<em>    long mantissa = strtod(loc+1, endptr); </em>

<em>    long whole = strtod(inStr, endptr);  </em>

<em>    printf(""whole: %d \n"", whole);      </em>

<em>    printf(""mantissa: %d"", mantissa);   </em>

<em>} </em>

8 0
3 years ago
Read 2 more answers
Other questions:
  • Microsoft Paint can be described as a digital sketch pad ?
    8·1 answer
  • What is a possible style of formatting your company could prefer?
    14·2 answers
  • All the answers I've got is 0, which seems strange but I'm sure I'm following this algorithm correctly.
    15·1 answer
  • What are technology trends in science check all that apply
    13·1 answer
  • How can you best protect yourself when using social media?
    14·2 answers
  • Suppose Host A wants to send a large file to host B. The path from Host A to Host B has three links, of rates R1 = 500 kbps, R2=
    13·1 answer
  • Select the answer that best describes the activity
    5·2 answers
  • Witch of the following is a malicious program that can replicate and spread from computer to computer?
    13·1 answer
  • What can be defined as in information technology environment?
    14·2 answers
  • When light does not pass through or bounce off an object, it is said to be
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!