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
ollegr [7]
4 years ago
15

For this question you should write code using the tools you learned so far. The code will find all the integers in the interval

from 1 to 12000 that are divisible by both 3 and 14. Print all the numbers that satisfy this criterion and also print a statement saying how many such number exist in the range. Hint: The "modulo" operator is denoted by a percent sign % in Python. It returns the remainder when two integers are divided. For example, 5%2 (read: "5 mod 2") returns a value of 1, because 5 divided by 2 is 2 with the remainder 1. The result of a modulo x%d is always between 0 and d-1. Use the modulo operator to help determine if one integer is divisible by another. Second Hint: Remember the logical operators and, or and not are available in Python.
Computers and Technology
1 answer:
kvasek [131]4 years ago
8 0

Answer:

The code in Python 3.7 than answers this question is given below:

def main():

 cont = 0

 for i in range(1, 12001):

   if i%3 == 0 and i%14 == 0:

     print(i)

     cont += 1

 print("{} numbers are divisible by 3 and 14".format(cont))

if __name__== "__main__":

 main()

Explanation:

#Create the main function, inside this is our logic to solve the problem

def main():  

#Define a cont variable that storage the amount of numbers that satisfy the condition given

 cont = 0  

 #For loop between 1 and 12000

 for i in range(1, 12001):

   #Use the mod function to know if is divisible by 3 and by 14

   if i%3 == 0 and i%14 == 0:

     #Print the number that satisfy the condition

     print(i)    

     #Refresh the cont variable if the condition is satisfied

     cont += 1

     #Print the output  

  print("{} numbers are divisible by 3 and 14".format(cont))

if __name__== "__main__":  

 #Run the main function

 main()  

 

You might be interested in
int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1, 2 }; Write a C++ program to ask the user to enter a number, if the number can b
Inessa [10]

Answer:

The c++ program to implement search through an array is shown.

#include <iostream>

using namespace std;  

int main()  

{

   int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1, 2 };

   int input;

   int found = 0;

   cout << " This program confirms whether your element is present in the array. " << endl;

   cout << " Enter any number  " << endl;

   cin >> input;

   for( int k = 0; k < 10; k++ )

   {

       if( input == sequence[k] )

           found = found + 1;

   }

   if( found == 0 )

       cout << " Not Found " << endl;

   else

       cout << " Found " << endl;

   return 0;

}

OUTPUT

This program confirms whether your element is present in the array.  

Enter any number  

7

Found

Explanation:

The program uses the given integer array.

User is prompted to input any number. No validation is implemented for user input since it is not mentioned. The user input is taken in an integer variable, input.

int input;

cout << " Enter any number " << endl;

   cin >> input;

Another integer variable found is declared and initialized to 0.

int found = 0;

Inside for loop, each element is compared with the user input.

If the user input is present in the given array, variable found is incremented by 1.

for( int k = 0; k < 10; k++ )

   {

       if( input == sequence[k] )

           found = found + 1;

   }

If value of variable found is 0, program displays “ Not Found ”.

If the value of variable found is greater than 0, program displays “ Found ”.

if( found == 0 )

       cout << " Not Found " << endl;

   else

       cout << " Found " << endl;

This program can be tested for both positive and negative numbers.

7 0
3 years ago
What would be the consequences if the Memory Manager and the
Ann [662]

Answer:

Result could be a memory leak or a spaceleak.

Explanation:

The result if a memory supervisor and a processor administrator quit conveying would prompt a negative result as they have to impart all together for the procedure manager to process the data that is being conveyed in and out.

3 0
3 years ago
What command issued from the command prompt will show the route that a packet travels from the issuing computer to another compu
svetoff [14.1K]

Answer:

B)tracert

Explanation:

Tracery Command can be regarded as

network diagnostic tool, it is used in tracking process of pathway of packet ranging from source to destination on IP network. It as well allows to know real time of each hops that are been taken by a packet as it enroutes to it's destination. The traceroute can be run by following these steps:

✓Open the run window

✓Open Command prompt, this can be done by enter "cmd" then enter.

✓ input" tracert" then destination ( Ip address or web address)

It should be noted that Tracery command issued from the command prompt will show the route that a packet travels from the issuing computer to another computer.

6 0
3 years ago
Let T(n) denote the running time for the Sort-and-Count algorithm (below). Sort-and-Count(L) { if list L has one element return
butalik [34]

Answer:

The answer is "\bold{T(n) = 2T(\frac{n}{2}) + n}"

Explanation:

Given:

The Merge-And-Count of (A,B) runs in time |Al+IB|

T(n) recurrence=?

Calculating the value of the recurrence:

\to  T(n) = T(\frac{n}{2}) + T(\frac{n}{2}) + f(|A| + |B|)\\\\  \therefore f(|A| + |B|) = n\\\\ \to T(n) = 2T(\frac{n}{2}) + n

7 0
3 years ago
A radio station records an interview with a computer scientist using a computer and audio recording software. Explain how sampli
andrew-mc [135]

The way sampling is used to store audio recordings are:

  • Sound capture.
  • converting digital signal.
  • sound wave capture, etc.

<h3>How is sampling used to store audio recordings?</h3>

In this process,  sound is taken in by the use of a microphone and so it is later converted into a digital signal.

Note that an analogue-to-digital converter is often used to taken in or capture a sound wave at frequent  time intervals. This recording is then regarded as a sample and the data is stored in a file for future use.

Learn more about interview  from

brainly.com/question/8846894

#SPJ1

4 0
2 years ago
Other questions:
  • Data mining must usestatistics to analyze data.<br> True<br> False
    12·1 answer
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • ​In addition to joint application development, another popular user-oriented method is _____, which resembles a condensed versio
    14·1 answer
  • Sukant’s professor asks her to take over his online class while he is away because she is an effective digital communicator. Whi
    11·2 answers
  • List the memory units inside and outside of the CPU, along with short descriptions of their
    11·1 answer
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • The property that allows a metal to be drawn into wires is called...
    9·1 answer
  • When should a computer definitely have an ip address
    15·2 answers
  • The aim of this activity is to implement an algorithm that returns the union of elements in a collection. Although working with
    6·1 answer
  • Can someone explain to me the process of inserting fonts into pdf, please? Also, related to this topic, metadata about a font th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!