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
Nitella [24]
3 years ago
14

4.3 mini programs AP computer science

Computers and Technology
1 answer:
allochka39001 [22]3 years ago
8 0

1.

name = input("Enter your name: ")

num1 = int(input("Hello "+name+ ", enter an integer: "))

num2 = int(input(name+", enter another integer: "))

try:

   if num1 % num2 == 0:

       print("The first number is divisible by the second number")

   else:

       print("The first number is not divisible by the second number")

except ZeroDivisionError:

   print("The first number is not divisible by the second number")

try:

   if num2 % num1 == 0:

       print("The second number is divisible by the first number")

   else:

       print("The second number is not divisible by the first number")

except ZeroDivisionError:

   print("The second number is not divisible by the first number")

2.

import random, math

num1 = float(input("Enter a small decimal number: "))

num2 = float(input("Enter a large decimal number: "))

r = round(random.uniform(num1, num2), 2)

print("The volume of a sphere with radius " + str(r) + " is " + str(round(((4 / 3) * math.pi * (r ** 3)), 2)))

I hope this helps!

You might be interested in
The details of various measurable characteristics related to IT outcomes of a cloud environment, are typically expressed in a
OlgaM077 [116]

Answer:

Service-Level Agreement (SLA).

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models and these are;

1. Platform as a Service (PaaS).

2. Software as a Service (SaaS).

3. Infrastructure as a Service (IaaS).

The details of various measurable characteristics related to information technology (IT) outcomes of a cloud environment or service, are typically expressed in a Service-Level Agreement (SLA).

Generally, a service level agreement (SLA) is usually between a service provider and its customers (end users).

In order to define and provide satisfactory service, organizations that provide services are expected to implement a service level agreement and it should comprise of the following parameters; responsibilities, expectations, metrics, time and frequency.

4 0
2 years ago
Write a function analyze_text that receives a string as input. Your function should count the number of alphabetic characters (a
laiz [17]

Answer:

def analyze_text(sentence):

   count = 0

   e_count = 0

   for s in sentence:

       s = s.lower()

       if s.isalpha():

           count += 1

       if s == "e":

           e_count += 1

   return "The text contains " + str(count) + " alphabetic characters, of which " + str(e_count) + " (" + str(e_count*100/count) + "%) are ‘e’."

Explanation:

Create a function called analyze_text takes a string, sentence

Initialize the count and e_count variables as 0

Create a for loop that iterates through the sentence

Inside the loop, convert all letters to lowercase using lower() function. Check each character. If a character is a letter, increment the count by 1. If a character is "e", increment the e_count by 1.

Return the count and e_count in required format

5 0
2 years ago
Can someone answer these 2 please
Leto [7]

Answer:

c for the first one and d for the secound one

Explanation:

5 0
2 years ago
Corona and app inventor can be used to develop ________.
Sidana [21]
<span>Corona and app inventor can be used to develop apps for smartphones. Corona can be used to build both games and apps from major platforms like iOS, Android, Kindle, Apple TV, Android TV, macOS, and Windows. App Inventor was originally provided by Google and is now maintained by MIT.</span>
3 0
3 years ago
What is the best approach to handling the expectation of privacy by employees in the event an investigation needs to be carried
Wittaler [7]

Answer

The best approach to handling the expectation of privacy by employees in the event an investigation needs to be carried out on company-owned digital assets:-<u>A well-defined published policy that clearly states that an employer has the right to examine, inspect or access company-owned assets.</u>

3 0
2 years ago
Other questions:
  • What are some good websites i can use to test my knowledge?
    11·2 answers
  • which of these describe raw data?check all of the boxes that apply A) what a person buys B) where a person lives C) data that ha
    9·1 answer
  • Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. Promp
    10·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • How are online sources used? Check all that apply.
    8·2 answers
  • Explain how a stored procedure is processed by the DBMS query processor (including the type of return value after the query is p
    15·1 answer
  • Someone please help ASAP will brainlist
    9·2 answers
  • Artificial intelligence (AI) and machine learning are especially important during which security information and event managemen
    8·1 answer
  • A(n) ____________________ key is a key that is not reused, but rather is only used once, thus improving security by reducing the
    5·1 answer
  • When evaluating an AND operator, what is necessary for execution?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!