Write a program that reads decimal numbers from the keyboard. The program reads at least three numbers. Find and display the smallest number, the second smallest number, and the third smallest number of the set. The program ends if the largest number encountered does not change for n iterations (the largest number does not change for the next n numbers since it changed). The value of n is read from the keyboard. Value n is greater or equal to 3.
Please enter the value of n: 3
Please enter a demical number: 1.1
The set of the samllest number, the second smallest
number and the third smallest number is {1.100000, I,
/}
Please enter a demical number: 1.2
The set of the samllest number, the second smallest
number and the third smallest number is {1.100000,
1.200000, /}
Please enter a demical number: 4
The set of the samllest number, the second smallest
number and the third smallest number is {1.100000,
1.200000, 4.000000}
Please enter a demical number: 2.3
The set of the samllest number, the second smallest
number and the third smallest number is {1.100000,
1.200000, 2.300000}
Please enter a demical number: 0.4
The set of the samllest number, the second smallest
number and the third smallest number is {0.400000,
1.100000, 1.200000}
Please enter a demical number: 2.2
The set of the samllest number, the second smallest
number and the third smallest number is {0.400000,
1.100000, 1.200000} Program ended with exit code: 0
Please enter the value of n: 1
Please enter a demical number: 4
The set of the samllest number, the second smallest
number and the third smallest number is {4.000000, I,
/}
Please enter a demical number: 2
The set of the samllest number, the second smallest
number and the third smallest number is {2.000000,
4.000000, /}
Program ended with exit code: 0

Answers

Answer 1

Answer:

Explanation:

The following code is written in Pyton and keeps prompting the user for new decimal values, once the user is done it loops through the array getting the highest three values and outputting them to the user.

def atleast_three():

   numbers = []

   smallest = 0

   medium = 0

   largest = 0

   while True:

       numbers.append(float(input("Please enter a decimal value: ")))

       answer = input("Add another value? Y/N").lower()

       if answer != 'y':

           break

       else:

           continue

   for x in numbers:

       if x > largest:

           largest = x

       elif (x > medium) & (x < largest):

           medium = x

       elif (x > smallest) & (x < medium):

           smallest = x

   print(str(smallest) + ", " + str(medium) + ", " + str(largest))


Related Questions

1. Mrs. Bautista has a bank balance of -42 dollars at the start of the month. After she
deposits 6 dollars, what is the new balance?​

Answers

Answer:

- 36

Explanation:

-42 + 6 = -36

Mrs. Bautista is kinda broke

Implement a class Quiz that implements the Measurable interface. A quiz has a score and a letter grade (such as B ). Use the implementation of the DataSet class to process a collection of quizzes. Display the average score and the quiz with the highest score (both letter grade and score).

Answers

Answer:

Explanation:

The following code is written in Java. The Measurable Interface and DataSet classes/Interfaces were found and implemented as requested. Then the rest of the code was created to work with and around those two methods to accomplish the task of Display the average score and the quiz with the highest score (both letter grade and score)

package sample;

interface Measurable {

       double getMeasure();

       String getGradeString();

}

class DataSet

{

   private double sum;

   private Measurable maximum;

   private String grade;

   private int count;

   public DataSet()

   {

       sum = 1;

       count = 0;

       maximum = null;

   }

   public void add(Measurable x)

   {

       sum = sum + x.getMeasure();

       if (count == 0 || maximum.getMeasure() < x.getMeasure())

           maximum = x;

           grade = x.getGradeString();

       count++;

   }

   public double getAverage() {

       return sum / count;

   }

   public Measurable getMaximum()

   {

       return maximum;

   }

}

class Quiz implements Measurable

{

   private double score;

   private String grade;

   public Quiz(double aScore, String aGrade)

   {

       this.score = aScore;

       this.grade = aGrade;

   }

   public double getMeasure()

   {

       return score;

   }

   public String getGradeString() {

       return grade;

   }

}

class QuizTester

{

   public static void main(String[] args)

   {

       DataSet quizData = new DataSet();

       Quiz q1 = new Quiz(85, "B");

       Quiz q2 = new Quiz(93, "A-");

       Quiz q3 = new Quiz(78, "C+");

       quizData.add(q1);

       quizData.add(q2);

       quizData.add(q3);

       System.out.println("Maximum: " + quizData.getMaximum().getMeasure() + ",  " + quizData.getMaximum().getGradeString());

       System.out.print("Average: ");

       System.out.printf("%.2f", quizData.getAverage());

   }

}

What are the uses of an interface in encapsulation?

Answers

Answer:

As you can see in the above examples, encapsulation is implemented in Java using interfaces, classes, access modifiers, setters and getters. A class or an interface encapsulates essential features of an object. Access modifiers (private, public, protected) restrict access to data at different levels. I don't know If this helps

Ans: As you can see in the above examples, encapsulation is implemented in Java using interfaces, classes, access modifiers, setters and getters. A class or an interface encapsulates essential features of an object. Access modifiers (private, public, protected) restrict access to data at different levels.

What do you need to start writing HTML?
Browser
Notes
Microsoft Word
Text Editor

Answers

Answer:

Text editor

Explanation:

You will need a text editor to start HTML

Jobs with only 7 letters

Answers

Answer:

nursing

Explanation:

it's needs 20 words so don't mind thisssss part hehe

Answer: Teacher!!!!!!

What are examples of Table Tools options that can help edit data?

Answers

Answer:

1 - change views

2 - change fonts

3 - add controls

4 - insert rows and columns

5 - add existing fields

6 - change margins

7 - view the property sheet

8 - change padding

Answer:

properties

add and delete

before change

Explanation:

Use the drop-down menus to match each description to the correct term.

Has records and fields:
Has columns and rows:
Enables a user to interact with a database without working directly with data:
Works like a dialog box:
An interface that makes it easier for inputting data into a database:
Enables you to search several tables for data:

Answers

The application software Cermine is used to record data, query the database to find specified data, format the display of a database object, and search for data entry. Other part of the question is discussed below:

What are the perfect match of the given words?

Application Software Cermine: Matching the items with the best options

To answer this question, you need to match each description on the left with the corresponding item on the right:

The first description is "A collection of records" which matches with "record".

The second description is "A data retrieval tool that finds specified data within a database" and this matches with "query".

The third description is "The display format that you choose when working with a database object on the screen" and this matches with "form".

The fourth description is "All of the fields for a single database entity" and this matches with "record".

The last description is "A data entry tool you use to input data into a database" and this matches with "Search".

Therefore, The application software Cermine is used to record data, query the database to find specified data, format the display of a database object, and search for data entry.

Learn more about Programming:

brainly.com/question/23275071

#SPJ3

Which of these titles will work in Java syntax?


hello world

Helloworld

helloworld

HelloWorld

Answers

Answer:

I am pretty sure it is D, "HelloWorld"

Answer:

HelloWorld is the answer

Explanation:

Remember Java syntax for naming projects and classes: begin with a capital letter, and then capitalize the first letter of each new word.

PLEASE SOMEONE ANSWER THIS
If the old code to a passcode was 1147, and someone changed it, what would the new code be?

(I already tried 4117)



[I forgot my screen time passcode please someone help I literally can’t do anything on my phone.]

Answers

Answer:

Any of these?

Explanation:

1147. 4117. 7411

1471. 4171

1714. 4711

1741. 7114

1417. 7141

Answer:

1417

Explanation:

Which of the following characterizes how an enabled security program might react to a new program installation on a computer system?


It might alert you to space requirement excesses.

It might report an error or tell you that the file is corrupted.

It might protect the new installation from getting viruses.

It might automatically set a restore point for the computer system.

Answers

Answer:

It might automatically set a restore point for the computer system

Answer:

It might report an error or tell you that the file is corrupted.

Explanation:

Question #4
Multiple Choice
You are going to open a file in your program.
aFile = open("___", "r")
Which statement is true about what goes in the blank?
O The text file must be in the same folder as the program.
O You can use the relative path to a subfolder within the folder where the program is saved.
O You must use backward slashes.
O The full path needs to be provided.

Answers

Answer:

You can use the relative path to a subfolder within the folder where the program is saved.

Explanation:

edge 2021

please remember to read the questions thoroughly bc in this class they give very similar questions with slight differences.

have a lovely day <3

The true statement about what goes in the blank is you can use the relative path to a subfolder within the folder where the program is saved. The correct option is B.  

What is data file handling?

Data is permanently stored in a storage device using files. The ability to save program output in a file and execute various operations on it is made possible by file handling.

A device's input and output actions are carried out on a stream, which is an abstraction of that device. The method for storing a program's output in a file and assisting with various operations on it is known as file handling in C++.

These data are stored permanently on a storage device thanks to files. Known facts or information are frequently referred to as "data."

Therefore, the correct option is B. You can use the relative path to a subfolder within the folder where the program is saved.

To learn more about data file handling, refer to the link:

https://brainly.com/question/29524491

#SPJ5

Write a program that will read two floating point numbers (the first read into a variable called first and the second read into a variable called second) and then calls the function swap with the actual parameters first and second. The swap function having formal parameters number1 and number2 should swap the value of the two variables

Answers

Answer:

In Python:

def swap(number1,number2):

   a = number1

   number1 = number2

   number2 = a

   return number1, number2

   

first = float(input("First Number: "))

second = float(input("Second Number: "))

print("After Swap: "+str(swap(first,second)))

Explanation:

The swap function begins here

def swap(number1,number2):

This saves number1 into variable a

   a = number1

This saves number2 into number1

   number1 = number2

This saves a (i.e. the previous number1) to number2

   number2 = a

This returns the numbers (after swap)

   return number1, number2

   

The main begins here

The next two lines prompt the user for first and second numbers

first = float(input("First Number: "))

second = float(input("Second Number: "))

This calls the swap function and print their values after swap

print("After Swap: "+str(swap(first,second)))

Amaya is curious how her computer actually boots up. Which of the
following should Amaya research to find out more?
hard drive
O RAM
OROM
O CPU

Answers

She should press OROM

Answer:

Options 1, Ram

Explanation:

That's how a computer works.

Which equipment is a standalone recorder?

Answers

Answer:

i think its Pro tool

Hopes it helps you

what is convergence ​

Answers

Answer:

the process or state of converging.

Explanation:

Answer:

the fact that two or more things, ideas, etc. become similar or come together.

Suppose you have a sentineled, doubly-linked list class as specified in project 2 and an object of that class called my_list. The function below finds and returns the first index of a specified value in that list, but portions have been removed. Using the minimum possible spacing at all in your answers, fill in the missing code. This algorithm does not employ the __iter__ and __next__ methods of the Linked_List class. Also note that this exercise does not include the object names, so your answers should include my_list. as appropriate. Finally, none of your responses should contain colons. As a reminder, the linked list implementation provides the following methods: insert_element_at(value, index) #cannot be used to append
append_element(value)
get_element_at(index)
remove_element_at(index)
__len__ #support for the len method to obtain the list's size
def index_of(my_list, val):
for k in :
if :
raise ValueError
and what is the performance?

Answers

Answer:

def index_of (my_list, val):

  for k in range(my_list.__len__):

      if my_list.get_element_at(k) == val :  

          return k

Explanation:

The python function "index_of" accepts two arguments, a list and the value to be searched for.

The for-loop iterates over the list using the "__len__" magic method to return the index of the searched term in the list if present.

How Charles Babbage Concept of
Computer has help the modern
Computer​

Answers

English mathematician and inventor Charles Babbage is credited with having conceived the first automatic digital computer. During the mid-1830s Babbage developed plans for the Analytical Engine. Although it was never completed, the Analytical Engine would have had most of the basic elements of the present-day computer.

Define the Database ​

Answers

A structured base in a computer

What is the most likely reason a user would export data with the formatting in place?

A) The fields will not have any errors.

B) The file will be much easier to read.

C) The file is automatically spellchecked.

D) The columns are automatically alphabetized.

Answers

Answer:

its d

Explanation:

Answer:

its b on edge

Explanation:

believe me if youre a viber

If you do not have the latest Java SDK in place when you download the Eclipse IDE, you will have to download the program again.


True

False

Answers

Answer:

True

Explanation:

What are some common predefined number formats used in the United States? Check all that apply.
ratings
zip codes
kilograms
phone numbers
Social Security numbers
employee numbers

Answers

Answer:

B)__(Zip Codes)

D)__(Phone Numbers)

E)__(Social Security Numbers)

Select the correct statement(s) regarding direct sequence spread spectrum (DSSS) and orthogonal frequency division multiplexing (OFDM).
a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum
b. OFDM has greater spectral efficiency compared to DSSS
c. DSSS relies upon a PN code that is only shared by the transmitter and receiver pair
d. all statements are correct

Answers

Answer:

a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum.

Explanation:

Orthogonal Frequency Division Multiplexing is a technique in which large digital data is sent over radio waves by splitting it into multiple subcarriers. The data is then transmitted to different users who can access the files. OFDM is not a spread spectrum technique, it is based on large frequency spectrum.

asnwer the question 1 name the different kinds of slide views present in power point​ (plz give me answer of this q plzz

Answers

Answer:

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Explanation:

PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation.

Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

Slide transition is an inbuilt feature of a presentation software that automatically changes the slides at regular intervals.

Basically, the different kinds of slide views present in Microsoft PowerPoint application includes;

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Presenter view avails the user an ability to use two monitors to display his or her presentation. Thus, one of the monitors displays the notes-free presentation to your audience while the other monitor lets you view the presentation with notes that you have added to the slides, as well as the navigation and presentation tools.

Which file type is used when forwarding a contact as a business card to another user to share their information?
PST
CSV
XML
VCF

Answers

Answer:

VCF

Explanation:

Answer:VCF

Explanation:

What is the diagram of a combination circuit that accepts a 3 bit number and generates an output binary number equal to the square of input number?​

Answers

Answer:

see picture

Explanation:

Disclaimer: I didn't design this; I found it.

Search for "3 bit square circuit".

7. Write a python program to get the following output.
1-----99
2-----98
3-----97
. .
. .
. .
98-----2
99-----1
whats is the code of this question

Answers

Answer:

for i in range(1,100):

print(f"{i}-----{100 - i}")

OR:

for i in range(1,100):

print(str(i)+"-----"+str(100 - i)")

Explanation:

First off, we can see that the program starts off with an iteration of 1 and ends at 100. So we use this loop code to begin:

for i in range(1,100):

Then, we use this code to print the pattern (make sure to indent this):

print(str(i)+"-----"+str(100 - i)")

We can also use f-strings as a better and cleaner alternative (make sure to indent this too):

print(f"{i}-----{100 - i}")

This code will get us the output shown in the question.

Which of these conclusions supports the fact that Eclipse is categorized as an IDE?


The user cannot use cheat sheets because it is frowned upon.

The user must get used to a proprietary and unique menu system.

The user must specify the programming language he or she wants to use.

The user must have a high level of expertise before quality results can be obtained.

Answers

Answer:

The user must specify the programming language he or she wants to use.

Explanation:

in a swap you need a variable so that one of the values is not lost ? Need help

Answers

Answer:

In a swap, the variable is cuttly.x

Explanation:

Answer:

temp

Explanation:

a worldwide system of computer network​

Answers

Answer:

The internet is a worldwide system of computer network.

Lena is completing her senior year of college and is living in an apartment with three friends. Her family has a subscription to HBO Go, and Lisa is able to use the log-on ID and password while she’s at college. Lena does not have cable TV or satellite TV as she typically streams shows or movies that are available online for free or through HBO Go. Several of Lena’s friends don’t have a subscription to Hulu, so Lena has given them her log-on ID and password so they can watch their shows. She doesn’t mind sharing the HBO Go subscription with her friends—what could it hurt? She has heard that the entertainment industry and HBO Go are upset over people sharing their subscription to the streaming services in this way. Lena’s sharing of her family’s HBO Go subscription is an example of:________
a) streaming piracy
b) illegal sharing
c) consumer copying
d) consumer misbehavior
e) digital stealing

Answers

Answer:

d) consumer misbehavior

Explanation:

This is an example of consumer misbehavior. What Lena is doing is not technically piracy or illegal because HBO has created the family feature on their accounts for the account to be used by multiple people at the same time. Yet, the feature was not intended to be used by individuals that are not technically family or even under the same roof. Therefore, what Lena is doing goes against HBO's reason for this feature and sharing the account as Lena is doing is ultimately hurting HBO's streaming service.

Other Questions
Henry draws a rectangle that is 3 inches wide and 4 inches long describe another rectangle Henry could draw that would have the same area but a different perimeter $4,637.10 2) ANNUITY. Suppose that you deposit $200 each month for 20 years into a retirement account earning 6% interest, and then stop making deposits and leave the money earning interest for another 10 years. a) How much will you end up with? Given: $163,198.43 b) How much did you contribute? First find actual deposit = $200 (12)(20) = ? Then SUBTRACT from part a) $71,427.85 Which principles does the preamble of the United States Constitution promote? Check all that apply.The Constitution includes all of the citizens of the nation.The Constitution promises an improved, unified government.The government outlined in the Constitution will protect citizens.The Constitution supports the full development of the nations citizens. The government outlined in the Constitution will be orderly and representative. PLS HELPSimply the expression by combining like terms.6x+9+2x+4= Which descriptions from the list below accurately describe the relationshipbetween AQRS and ATUV? Check all that apply. Please I need help this is 50% of my grade Which choice is in the correct order, starting with what scientists think happened or formed first? The second place finisher will be either Serena or ___ . Would I use She or Her? PLSSS HELLPPPPP ASAPPP Why was the League of Nations too weak to achieve this goal and provide, in your answer, one example demonstrating the weakness of the League of Nations during the years leading up to the start of World War II. In large cities, people with the same culture often live in segregated areascalled *A.Cultural EnclavesB.The SuburbsC.Ethnic EnclavesD.Cultural AgglomerationsPop culture is diffused around the world by*A.Streaming showsB.MoviesC.Social mediaD.All of above PLEASE HELPDaylight Savings Time has pros and cons. Do you think the pros outweigh the cons and therefore Daylight Savings Time should continue? Instead, do you think the cons outweigh the pros and therefore Daylight Savings Time should be abolished?Explain. what is the deficiency disease for carbohydrate Presidents Harding and Coolidge would be considered to be.)Pro-warB.)Anti-warC.)Pro-businessD.)Anti-business Hannah boiled a pot of water on the stove. Then, she placed the pot on the counter. After a few minutes, the water in the pot hadcooled. Explain what happened.A)Heat energy moved from the pot to the counter.B)The counter transferred heat energy to the pot.Heat energy flowed out of the water and back to the pot.D)The boiling water cooled off by transferring heat into the freezer.P Sold the inequalityX/(-12) < -12 PLEASE SOMEONE ANSWER THISIf the old code to a passcode was 1147, and someone changed it, what would the new code be? [I forgot my screen time passcode please someone help I literally cant do anything on my phone.] 9/17 as a decimal rounded to the nearest hundredth PLSSS HELP DUE IN 5 MINUTES!!!!PLEASE DO NOT ANSWER JUST FOR POINTS!!!LOOK AT THE IMAGE FOR THE QUESTIONS AND ANSWERS NOTE: The first answer (0,9) is incorrect I tried and it was wrong so please its either (9,0) or (3,0) Which statements best describe how the author uses more than one structure to present information in From Barter to Bitcoin?Select the two correct answers.A. A comparison of different currencies is used to demonstrate how the value of money is different across countries.B. The text compares the quality of different types of banking systems.C. The author uses chronology to explain the long history of money.D. The author presents problems with modern currencies and describes how new currencies could be introduced as solutions.