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
postnew [5]
3 years ago
14

Write a program that reads in 10 numbers and displays the number of distinct numbers and the distinct numbers in their input ord

er and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). After the input, the array contains the distinct numbers. Here is a sample run of the program.
Computers and Technology
1 answer:
Alla [95]3 years ago
8 0

Answer:

Explanation:

The following code is written in Python. It creates a for loop that iterates 10 times, asking the user for a number every time. It then checks if the number is inside the numArray. If it is not, then it adds it to the array, if it is then it skips to the next iteration. Finally, it prints the number of distinct numbers and the list of numbers.

numArray = []

for x in range(10):

   num = input("Enter a number")

   if int(num) not in numArray:

       numArray.append(int(num))

print("Number of Distince: " + str(len(numArray)))

for num in numArray:

   print(str(num), end = " ")

You might be interested in
A a a a I don't need help!?
Arlecino [84]

Answer:

ok

Explanation:

ok

6 0
2 years ago
g Create a package named lab7 (no spaces, ALL in lowercase) where you will place your lab files. Write a class FilterWith with a
sweet [91]

Answer:

See explaination

Explanation:

import java.util.ArrayList;

import java.util.Scanner;

public class ListFilter

{

public static void filterRange(ArrayList<Integer> list,int min, int max)

{

ArrayList<Integer> listNew=new ArrayList<Integer>();

for(int i=0;i<list.size();i++)

{

if(list.get(i)>=min && list.get(i)<=max) //Checking if element is between min and max

{

listNew.add(list.get(i));

}

}

list.removeAll(listNew); //removing all elements from list.

}

public static void main(String[] args)

{

ArrayList<Integer> list=new ArrayList<Integer>();

list.add(4);

list.add(7);

list.add(9);

list.add(2);

list.add(7);

list.add(7);

list.add(5);

list.add(3);

list.add(5);

list.add(1);

list.add(7);

list.add(8);

list.add(6);

list.add(7);

Scanner sc=new Scanner(System.in);

System.out.println("Enter min : ");

int min=sc.nextInt();

System.out.println("Enter Max : ");

int max= sc.nextInt();

filterRange(list, min, max);

//Displaying new List

for(int i=0;i<list.size();i++)

{

System.out.print(list.get(i)+" ");

}

}

}

3 0
3 years ago
5.8.1 Ghosts Python Codehs
eduard

To use Ghost's Python Codehs, we need to install Pygame, for it to work.

<h3>How to use pygame?</h3>

Pygame has several ways to install. Let's do the installation here from the PyCharm environment itself. In the project interpreter, the new virtual environment is already configured, you click on the plus sign, type Pygame, check if it is this one. There's a lot of Pygame, but it's this one alone, with nothing, version 9.6. Click on it and on the installation package button.

If all goes well, Pygame will be successfully installed, and you will be able to use it in your project.

Learn more about code brainly.com/question/497311

8 0
1 year ago
Rita used information from a blog that someone else wrote. What should she do?
Shkiper50 [21]

Answer:

rita should either ask the original author for permission to use her blog, but the best answer woyuld be that she should site her sources.

Explanation:

7 0
2 years ago
What type of IPv6 address should you use when you have multiple routers on a subnet and want hosts to use the nearest router for
kirill115 [55]

Answer:

anycast

Explanation:

Anycast -

It refers to as the routing methodology and the networking address where only one destination address has more than two pathway for the end destination , is referred to as an anycast .

In this case , the router has the capability to select the pathway to reach the destination , depending on the latency measurement , cost , distance and hops .

Hence , from the given information of the question ,

The correct answer is anycast .

8 0
3 years ago
Other questions:
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • To use a stored address, C provides us with an indirection operator, ____.
    6·1 answer
  • Lisa wants to send an email with some confidential Information. Which of these options would work best for her?
    6·1 answer
  • Two samples of dirt are collected from a suspect's tread in his shoe and a crime scene. The forensic investigator does a gross e
    6·2 answers
  • Write a program in C++ or C that includes two different enumeration types and has a significant number of operations using the e
    15·1 answer
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • The question of ________ arises when considering the way in which online marketers gather consumers’ information over the Intern
    6·1 answer
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
  • Raina remembered when she taught Amara to draw. What happened?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!