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

Given:

Computers and Technology
1 answer:
777dan777 [17]4 years ago
6 0

Answer:

Python Code:-

#creating a list  

current_members = [4, 6, 9]

#defining the variable  

#assigning the value

member_id = 9

#defining variable count

count = 0

#defining the variable and setting initial value to true

is_a_member = False

#for loop is used to iterate over the list  

for x in current_members:

  #if statement will check whether the element is found

  if x == member_id:

      #set the value to true if the value is matched  

      is_a_member = True

      #set the value to 1

      count = 1

#if count == 0

#set the value of is_a_member variable to false

if count == 0:

  is_a_member = False

#print the current value stored in is_a_member variable

print(is_a_member)

Explanation:

In the above python program, a list is created that is "current_members"  and some values are inserted. In the next line, a three-variable is defined that are member_id, count, and is_a_member.

  • In both variable member_id, count assigns some value. and in is_a_member variable assign a False value.
  • Using a for loop to iterate over the list.
  • Inside the loop, If the statement will check whether the element is found. Then set the value of is_a_member variable to True and count to 1.
  • Another if the statement is used which checks the value of the count variable. If the value of count is 0 then set the value of is_a_member to False.
  • print() function is used to display the current value of is_a_member variable.
You might be interested in
Write a method that determines the total number of chars in each string of an array.
Serjik [45]
The total number of chars in each string is basically the size of each string.

Using JAVA:

        String[] arr = {"hello", "my", "name", "is", "Felicia"};                int count = 0;        for(int i = 0; i < arr.length; i++) {            count = count + arr[i].length();            System.out.println("Characters in " + arr[i] + ": " + count);        }

Output: 
<span>Characters in hello: 5
Characters in my: 7
Characters in name: 11
Characters in is: 13
Characters in Felicia: 20</span>


8 0
3 years ago
Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and de
Andreas93 [3]

Answer:

Following are the solution to the given question:

import java.util.Scanner;//import package

public class AscendingAndDescending//defining a class AscendingAndDescending  

{

   public static void main(String[] args) //main method

   {

       int n1,n2,n3,min,max,m;

       Scanner in = new Scanner(System.in);//creating Scanner class object

       System.out.print("Enter an integer: ");//print message

       n1 = in.nextInt();//input value

       System.out.print("And another: ");//print message

       n2 = in.nextInt();//input value

       System.out.print("And just one more: ");//print message

       n3 = in.nextInt();//input value

       min = n1; //use min variable that holds value

       max = n1; //use mix variable that holds value

       if (n2 > max) max = n2;//use if to compare value and hols value in max variable

       if (n3 > max) max = n3;//use if to compare value and hols value in max variable

       if (n2 < min) min = n2;//use if to compare value and hols value in min variable

       if (n3 < min) min = n3;//use if to compare value and hols value in min variable

       m = (n1 + n2 + n3) - (min + max);//defining m variable that arrange value

       System.out.println("Ascending: " + min + " " + m + " " + max);//print Ascending order value

       System.out.println("Descending: " + max + " " + m + " " + min);//print Descending order value

   }

}

Output:

Enter an integer: 8

And another: 9

And just one more: 7

Ascending: 7 8 9

Descending: 9 8 7

Explanation:

In this program inside the main method three integer variable "n1,n2, and n3" is declared that inputs value from the user end and also defines three variable "min, max, and m" that uses the conditional statement that checks inputs value and assigns value according to the ascending and descending order and prints its values.

5 0
3 years ago
The minimum spanning tree of an undirected graph G exists if and only if G is connected. True or False?
zlopas [31]

Answer: True

Explanation:

The definition of minimum spanning tree(MST) says that the graph must be connected and undirected to be considered for MST. It has (V-1) edges where V is the number of vertices. The minimum spanning tree is implemented using Kruskal's algorithm whereby it starts by considering the minimum weighted edge and covers all the edges upto (V-1) edges. So for MST it has to be connected

3 0
3 years ago
What phrase indicates someone has knowledge and understanding of computer,internet,mobile devices and related technologies?
navik [9.2K]

Digital literacy is the term for having knowledge of computers, internet, mobile devices and related technologies.

7 0
3 years ago
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which function should be used to display a value based on a comparison?
    11·1 answer
  • The ____ developed numerical methods for generating square roots, multiplication tables, and trigonometric tables used by early
    12·1 answer
  • A network administrator is configuring the triggering mechanism for the network-based IPS by defining a pattern of web surfing a
    10·2 answers
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • Which hardware device connects your network to the internet? select one:
    15·1 answer
  • What is NOT a built-in function in python?<br> sqrt()<br> string()<br> fabs()<br> O print()
    12·2 answers
  • The Curiosity Rover has recently landed on Mars and likes to send Twitter updates on its progress. If a tweet is posted 10 minut
    6·1 answer
  • Why is it important to isolate evidence-containing devices from the internet?
    11·1 answer
  • How do you enlarge an image to see more detail on it? (1 point)
    14·2 answers
  • A eclipse occurs at a full moon when the moon passes between earth and the sun
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!