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
Which code will allow Joe to print Coding is fun. on the screen? print("Coding is fun.") print(Coding is fun.) print = (Coding i
ludmilkaskok [199]

Answer:

print(“Coding is fun.”)

Explanation:

The proper format for a print statement is usually you have the print statement followed by the string in quotes in parentheses.

Hope this helped!

7 0
3 years ago
Read 2 more answers
Given the declarations struct BrandInfo { string company; string model; }; struct DiskType { BrandInfo brand; float capacity; };
Nonamiya [84]

Answer:

Type of myDisk.brand is BrandInfo.

Explanation:

4 0
3 years ago
Smith, Smith, Smith, and Smith (S4) is a regional accounting firm will be moving to a new four-story building. There will two Lo
ICE Princess25 [194]

Answer:

Crosstalk, Jitter, Impulse noise.

Explanation:

Crosstalk is a network error that occurs when one pair of cable causes interference on another pair of cables thereby preventing efficient data transmission.

Jitter may also impair the accuracy of the data being transmitted across network because minute variations in amplitude, phase, and frequency always occur. The generation of a perfect carrier signal in an analog circuit is almost impossible. The signal may be affected by continuous and rapid network gains or phase changes.

Impulse noise (also referred to as spikes) is the primary source of errors in data communications.  Impulse noise can be caused by positioning a communications cable near a source of intermittent but strong electromagnetic pulses, such as an elevator motor.

Counter measures

Shielding (protecting wires by covering them with an insulating coating) is one of the best ways to prevent impulse noise, cross-talk.

Amplifiers can be used to increase signal strength since the connection would run across 4 floors.

5 0
3 years ago
Which of the following is an example of a stereotype?
amm1812

Answer:

d)"I have a really bad feeling about her. I don't know why."

Explanation:

5 0
2 years ago
Write the printItem() method for the base class. Sample output for below program:
Anna [14]

Answer:

The printItem() method code is filled in the explanation, highlighted with bold font.

Explanation:

// ===== Code from file BaseItem.java =====

public class BaseItem {

  protected String lastName;

  public void setLastName(String providedName) {

      lastName = providedName;

      return;

  }

// FIXME: Define printItem() method

/* Your solution goes here */

  public void printItem() {

      // TODO Auto-generated method stub

      System.out.println("Last name: "+lastName);

  }

}

// ===== end =====

4 0
3 years ago
Other questions:
  • Produce definition in computer
    12·2 answers
  • When is Hytale coming out?<br><br><br> P.S it might be Mine-craft 2.0<br><br><br> :)
    7·1 answer
  • What are three requirements of information technology a. Accuracyb. _______________________________c. __________________________
    13·1 answer
  • Visual imagery encoding relates to _____ encoding, in that a person is connecting the new information to previously existing inf
    11·1 answer
  • Which shape is used for input or output?
    15·1 answer
  • To print a budget:________.
    9·1 answer
  • What is theory of knowledge?​
    13·1 answer
  • You are planning a storage solution for a new Windows server. The server will be used for file and print services and as a datab
    6·1 answer
  • What is the difference between RELIABLE and UNRELIABLE sources of<br> income?
    7·2 answers
  • Which of the listed tools would a barber likely use in the following scenario?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!