Explanation:
I don't really understand what you're trying to get at, maybe try to abbreviate a little more?
Answer:
Check the explanation
Explanation:
// include the necessary packages
import java.io.*;
import java.util.*;
// Declare a class
public class DataReader
{
// Start the main method.
public static void main(String[] args)
{
// create the object of scanner class.
Scanner scan = new Scanner(System.in);
// Declare variables.
boolean done = false;
boolean done1 = false;
float sum = 0;
double v;
int count = 0;
// start the while loop
while (!done1)
{
// start the do while loop
do
{
// prompt the user to enter the value.
System.out.println("Value:");
// start the try block
try
{
// input number
v = scan.nextDouble();
// calculate the sum
sum = (float) (sum + v);
}
// start the catch block
catch (Exception nfe)
{
// input a character variable(\n)
String ch = scan.nextLine();
// display the statement.
System.out.println(
"Input Error. Try again.");
// count the value.
count++;
break;
}
}
// end do while loop
while (!done);
// Check whether the value of count
// greater than 2 or not.
if (count >= 2)
{
// display the statement on console.
System.out.println("Sum: " + sum);
done1 = true;
}
}
}
}
Sample Output:
Value:
12
Value:
12
Value:
ten
Input Error. Try again.
Value:
5
Value:
nine
Input Error. Try again.
Sum: 29.0
If multiple choice then d and a if not then the best one would be a!
hope this helps!!
The function use to get the number of element in a dictionary is len.
<h3>What is a dictionary?</h3>
Dictionaries are used to store data values in key-value pairs. Dictionary are ordered.
Dictionary in python are express as follows:
my_dict = {"name": "Michael", "age": 28, "school": "Oxford"}
Therefore, the length of the element of the dictionary can be gotten using the len() function.
Hence,
print(len(my_dict)) will give you the length of the element.
learn more on dictionary here: brainly.com/question/14120893
#SPJ11
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The selection sort algorithm step started from 0, and continue till the sorting is done.
The correct answer after selection sort algorithm at the 4th step is:D
[0,1,2,4,8,10].
The complete detail of step by step execution is shown in the attached document file.