4.3 mini programs AP computer science

Answers

Answer 1

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!


Related Questions

Guess The Song:
What Popping Brand New Whip Just Hopped In, I Got options

Answers

WHATS POPPIN

Song by Jack Harlow

Which technology forms the foundation for cloud computing?

Answers

Answer:

Cloud Computing

Cloud Computing

Cloud computing is the on-demand availability of computer system resources, especially data storage (cloud storage) and computing power, without direct active management by the user. The term is generally used to describe data centers available to many...

Explanation:

Answer:

The answer is virtualization

Virtualization is the creation of virtual versions of something such servers, storage devices, operating systems, that allows one to share an application or a resource among multiple customers or organizations. It plays a critical role in cloud computing through sharing data that is present in the clouds like application and infrastructure.

Explanation:

What is the function of a breadcrumb trail in a website?

Answers

It lets users keep track of what they’re doing

Answer: traces between homepage and current web page

Explanation:

Write a program that uses a scanner to report some statistics about words in an input sentence ( see Section 7.8). The outputs should be the number of words in the sentence, the average word length, and the length of the sentence.

Answers

import java.util.Scanner;

public class JavaApplication77 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = scan.nextLine();

       String [] arr = new String[sentence.length()];

       arr = sentence.split(" ");

       System.out.println("There are "+arr.length+" words in the sentence.");

       int count = 0;

       for(int i = 0; i < arr.length; i++){

           count += arr[i].length();

       }

       System.out.println("The average length of a word in your sentence is "+(count/arr.length)+" characters");

       count = 0;

       System.out.println("Your sentence is "+sentence.length()+" characters long.");

       

   }

   

}

For the length of a sentence, I included spaces as characters but I did not do this for the length of a word. I hope this helps!

The primary benefit of digital distribution is that more audiences are able to purchase and view a film
True or False?

Answers

Explanation:

The answer could be either-or. At the moment True because people are in quaritine and can't go to movie theaters or go buymovies from a store. It could also be false because not everyone owns a computer or has access to the internet. Also, the number of family houses that have internet are growing.

It all depends on the context I guess. You could say true becuase the number of families with wifi is growing and we're all being quarantined or you could say false because not everyone has access to the internet.


Connie needs to use the data consolidation tool in Excel 2016. Where can she find this capability?

Answers

The answer is D

Explanation:

I just took the test and got 100%

Discuss some of the ways to allow a non-Windows device to authenticate with a Windows based network.

Answers

The existing rules are setup to allow access based on windows group membership. I need to get a wireless jetdirect connected to the wifi network.

what does he put the cd drive

Answers

Answer:

a disk drive duh

Explanation:

Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the
JOptionPane statement and a System.out statement to output a message inside the loop highlighting a pass
mark >= 50 and <= 100. Any other mark will output a messaging stating it’s a fail.
Example of the expected output is as follows:
55 is a pass
12 is a fail

Answers

Answer:

Written in Java

import javax.swing.JOptionPane;

public class Decision{

public static void main(String[] args) {

    int i = 1;

    while(i<=5){

    String score = JOptionPane.showInputDialog("Input <score>");

    int mark = Integer.parseInt(firstNumber);

    if(mark >= 50 && mark <= 100) {

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

    else{

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

    i++;

    }

}

}

Explanation:

This initializes the a counter variable i to 1

    int i = 1;

The following iteration is repeated as long as i is less than or equal to 5

    while(i<=5){

This prompts user for input

    String score = JOptionPane.showInputDialog("Input <score>");

This converts user input to integer

    int mark = Integer.parseInt(firstNumber);

This checks if input is within 50 and 100 (inclusive)

    if(mark >= 50 && mark <= 100) {

This prints pass

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

If otherwise

    else{

This prints fail

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

This increments the counter variable by 1

    i++;

    }

goods purchased from Ravi rs 30000 and paid cash with cash discount of 5%​

Answers

Answer:

rs 24000 I believe

Explanation:

Which are benefits of group discussions? Check all that apply. Learning becomes more interesting. Students engage in learning. Learning involves less work. Less preparation is required. Preparation is encouraged.

Answers

Answer:

1st and 3rd one

Explanation:

because it's right

Answer:

im preety sure its the first, 2nd and 4th one but im not completely sure

Explanation:

The location of a file is specified by its ________. a. domain b. file path c. file type d. file extension

Answers

Answer:

File path

Explanation:

Literally, file path implies the location of a particular file

This in other words means that: the location of a file is defined or specified by its path.

Take for instance a text file named abc located at the desktop could have its file location to be C:\Users\HP\Desktop\abc.txt

Other options such as file type means the type of the file which could be a text file, an image, etc. and file extension is a suffix that indicates the file type (e.g. jpg, txt, png, etc).

So, from the list of given options; file path answers the question.

How can you tell that your worksheet is in Macro Recording mode?
A) A gray box is next to the word Ready in the bottom left corner.
B) The word Record is next to Ready in the bottom left corner.
C) The word Ready is in the bottom left corner.
D) A red light flashes next to the word Ready in the bottom left corner.

Answers

Answer:

A

A gray box is next to the word ready in the bottom left corner

Explanation:

A gray box is next to the word Ready in the bottom left corner can you tell that your worksheet is in Macro Recording mode. Thus, option (a) is correct.

What is recording?

The term recording refers to record the data on the worksheet as well as the recording on the mic. The recording was the recording was the necessary to maintain. The recording was the accounts and the audio was the also as the record in the terms. The recording was the voice modulation of the recorder.

A worksheet was the important term in the recording of the data. The recording in the workbook are the easy to find and the properly managed. The recording was the necessary to maintain the data. The gray color box and the search, the next is the ready button of the left in the corner.

Therefore, option (a) is correct.

Learn more about on recording, here:

https://brainly.com/question/10677268

#SPJ2

Name three technologies and what their used for before the creation of computers (first to answer correctly will get branlies

Answers

Morse, to send information quicker during a war

Telegram, to send news across the country

And possibly radio?

A _____ is relatively inexpensive to install and is well-suited to workgroups and users who are not anchored to a specific desk or location.​
A) local area network (LAN)
B) wireless local area network (WLAN)
C) metropolitan area network (MAN)
D) storage area network (SAN)

Answers

Answer:

B) wireless local area network (WLAN)

Explanation:

WLAN which fully meaning is WIRELESS LOCAL AREA NETWORK is a network provider that enables two or more mobile phone user , desktop or computer user to connect and have access to the internet by simply connecting to the local area wireless network and this type of wireless network are more cheaper to install.

Example of where WIRELESS LOCAL AREA NETWORK can be found are : School building, Office building, School campus, home, among others.

In HTML, what is an element?
O The text browser displays when a user points the mouse pointer to it
O The tag that tells the web browser what the source of a file is
O The combination of a start and end tag, not including the tagged content
O The combination of a start and end tag, together with the tagged content

Answers

Answer:

The right answer is Option D: The combination of a start and end tag, together with the tagged content

Explanation:

HTML stands for hypertext markup language. It is one of the most commonly used languages on the internet.

Element:

An element in HTML consists of a start tag and end tag, and contains some content between the two tags.

i.e.

<tag> Content </tag>

Hence,

The right answer is Option D: The combination of a start and end tag, together with the tagged content

Answer:

The right answer is Option D: The combination of a start and end tag, together with the tagged content

Explanation:

What should you do if you do not understand the directions on a test?

Answers

Answer:

ask your teacher for a little guidence.

Explanation:

even though you may not get the answer you need they might give you some assitance

Fill in the blanks: The ____is useful when the most common value of a data set is required. A.mean B.median C.mode

Answers

Answer:

C.Mode

Explanation:

The mode is useful when the most common value of a data set is required.

mode. an easy way to remember is MO from mode can stand for most often

Zoe has been asked to identify the external links that exist in a workbook that has primarily been managed by
another employee.
Which feature should she use?

Answers

Answer:

Data tab and external links group.

Explanation:

I'm not 100% sure but it makes the most sense

Answer:data tab and external links group

Explanation:

1. Describe the general characteristics of a program that would exhibit very high amounts of temporal locality but very little spatial locality with regard to data accesses, and give an illustrative example.2. Describe the general characteristics of a program that would exhibit very little temporal and spatial locality with regards to data accesses.3. Describe the general characteristics of a program that would exhibit very little temporal locality but very high amounts of spatial locality with regards to data accesses.

Answers

Answer:

A program with high temporal locality with regards to data access is the tight or continuous use of a loop and a memory in chunks, while low temporal locality is little or no reuse of loop and memory. The high amount of spatial locality is the little or no reuse of branches in data access, while low spatial locality is the high reuse of branches in the code.

Explanation:

Computer program requires for a written source code to retrieve and save data to memory. A high temporal locality uses loops to continuously access memory. For speed, all the read instructions are done and the data is cached in an iterable data structure.

Spatial locality is the degree of the use of branches in a code. if more branches are used in the program, then the program is said to have low spatial locality, if little or no branches are used, then the code has high spatial locality.

JPG is considered a lossy file format. What does this mean?
O JPG files are insecure.
O JPG files compress efficiently but have compromised quality.
O JPG files are easy to delete.
O JPG file compression can be reversed.
PLEASE HELPPPPP!!!!!

Answers

Answer:

either a or b

Explanation:

Answer:

A it files are insecure

Explanation:

Draw a concept map that shows how the STEM careers are connected.

Answers

Answer:

attached below is the concept map needed

Explanation:

STEM : science technology engineering and mathematics

attached below is the concept map

from the map we can make an example on how this careers are connected

example : Production of chemical substance

science ; gives the chemical combination neededtechnology ; helps keep people safe from its hazardsengineering ; produces the chemical substancemathematics ; provides accurate measurement

A web page that allows interaction from the user​

Answers

Answer:

Its A Dynamic Web Page

Explanation:


Using complete sentences post a detailed response to the following.
Virtual reality is still pretty new. Brainstorm and discuss several ways that VR programs could be used to benefit society.
What are some drawbacks?

Answers

Answer:

Headaches and Car sickness is likely whats sopping most ppl from using vr- tho that masy never go away i think thats the number one drawback

Explanation:

Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of times the user inputted in reverse order. I believe it's supposed to use nested loops, but I can only get it to repeat the whole word backwards x times.

ex.
Input a String:
code
Input an integer:
3
eeedddoooccc

Answers

import java.util.*;

public class myClass {

public static void main(String args[]) {

Scanner scan = new Scanner(System.in);

System.out.print("Input a String: ");

String str = scan.nextLine();

System.out.print("Input an integer: ");

int num = scan.nextInt();

for(int i=str.length()-1; i>=0; i--) {

for(int j=0; j<num; j++) {

System.out.print(str.charAt(i));

}

}

}

}

What's one example of action could you take on the Internet that would be both unethical and illegal?

Answers

Answer:

bullying

Explanation:

bullying affects a person mentally via the technological medium which can even result in future physical harm, henceforth it is unethical

Bullying is  one example of action could you take on the Internet that would be both unethical and illegal.

What is Bullying?

Bullying is a type of hostile behavior in which one person purposefully and repeatedly causes harm or discomfort to another. Bullying can occur through verbal abuse, physical aggression, or more covert tactics.

The victim of bullying generally struggles to defend themselves and does nothing to "cause" the bullying.

Cyberbullying is the verbal threatening or harassing behavior carried out on electronic platforms such text messages, social media, email, and cell phones.

Therefore, Bullying is  one example of action could you take on the Internet that would be both unethical and illegal.

To learn more about Bullying, refer to the link:

https://brainly.com/question/10566405

#SPJ3

2) - How many integers between 1 and 500 inclusive are divisible by either 2, 3, or 5?

Answers

366 numbers between 1 and 500 are divisible by 2, 3, or 5.

We can check this with the following code:

Matt creates a Java class as part of his college assignment. He wants this class to be accessible within the current package only. Which access specifier should Matt use?

Matt has another Java assignment with multiple classes. In this assignment, there is a general class. A few subclasses outside the package use methods from this general class. Which access specifier should Matt use for the general class?

Matt should use the (blank) access specifier for the first class.

A. Protected
B. Default
C. Private
D. Public

He should use the (blank) access specifier for the general class.

A. Protected
B. Public
C. Default
D. Private

Answers

Answer:

first use Default as

a class with the default access modifier in a package, only those classes that are in this package can access this class. No other class outside this package can access this class.

general uses protected to make itself accecible to the subclasses.

Which of the following trims would be used at the beginning of a scene?
A)Utilized sound
B)Post trim
C)Tail trim
D)Head trim

Answers

Answer: a i think

Explanation:

Which of the following indicates branching of the program flow based on a condition?

input/output symbol
flow line symbol
decision symbol
process symbol
______________________________________________________________
Which of the following symbols depicts one distinct action in a program?

decision symbol
process symbol
input/output symbol
predefined process symbol

Answers

Answer:

Which of the following indicates branching of the program flow based on a condition? decision symbol

Which of the following symbols depicts one distinct action in a program? process symbol

Explanation:

Flow chart is the graphical representation of a process or algorithm.

Which of the following indicates branching of the program flow based on a condition?

The condition has two options to be processed based on its result hence the program is divided into branches after the decision of process.

The decision symbol is used for this purpose.

Which of the following symbols depicts one distinct action in a program?

The distinct action only involves one action. Out of the given options, process symbol is used for distinct action.

Hence,

Which of the following indicates branching of the program flow based on a condition? decision symbol

Which of the following symbols depicts one distinct action in a program? process symbol

Other Questions
Scientists digging in a cave found an unknown substance. The scientistsfound that the substances molecules were moving around each other. The scientistsincreased the speed of the substances molecules and caused a phase change. Howdid the scientists do this, and how did this affect the substance? i hope you guys had a wonderful day :D sometimes people in a minority group share characteristics that they do not share with the dominant group. what is a scenario that best represents the occurrence? Jesse is filling spherical balloons. When full, one of these balloons has a diameter of 24\text{ cm}24 cm24, start text, space, c, m, end text. Jesse can fill a balloon at a rate of 820\text{ cm}^3820 cm 3 820, start text, space, c, m, end text, cubed per breath.How many breaths does it take Jesse to fill a balloon? Bianca wrote the steps for her solution to the equation 2.3 + 8(1.3x 4.75) = 629.9. She left out the description for the last step. A table titled Bianca's Solution with 2 columns and 5 rows. The first row has the entries, blank, Steps, Resulting equations. The second row has the entries, 1, Use the distributive property to simplify, 2.3 plus 10.4 x minus 38 equals 629.9. The third row has the entries 2, Combine like terms, 10.4 x minus 35.7 equals 629.9. The fourth row has the entries, 3, Use the addition property of equality, 10.4 x equals 665.6. The fifth row has the entries, 4, blank, x equals 64. What is the missing step of her solution? Add 10.4 to both sides. Add negative 10.4 to both sides. Multiply both sides of the equation by 10.4. Divide both sides of the equation by 10.4. Find AB I need help ASAP please What is the common difference of the sequence below?9, 14, 20, 28Question 17 options:56this sequence does not have a common difference5, 6, 8 1. Fue fcil o difcil descubrir el nuevo paradero de los indios?2. Da que no pudieron escapar?3. Qu era preciso buscar?4. Qu tenan que precisar los indios?5. Tuvieron xito?6. Qu hacan los soldados espaoles al anochecer?7. Qu hizo el campo indio aquella tarde? Adndellegaron? Cundo?8. Qu vio la ronda espaola?VA Descend 13ft Please help Question:If the soil is made up of large particles, what size will the air spaces be? help plssssssssssssssssssss (-1, 6) (x -9) determine value of x algebraically, show work.Please help i legit cannot understand this, will offer brainliest What ya'll doing in brainly these days What is the board game "Salem" all about. write a informal letter to your cousin telling her about how you spent your Christmas in full Just a simple question :p There is a banana in the bag. How do you find the rate of change 5% of what number is 6120301282 The teacher suggested that her students organize their presentations in one of four logical patterns. Which of the following patterns aas most likely on her list? A.fast to slow(speed)B.first event to last(chronology) C.funny to sad (emotion)D. loud to quiet (volume)