As I've said before, there are three types of numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.
Let's code this.
Input
Multiple lines containing a decimal.
2.4434
-1.3433
-2.444
6.432
0Output
A line containing a decimal with three decimal places.
-3.787Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3.
Let's go!
Input
A line containing an integer.
8Output
Multiple lines containing an integer.
4
5
6
7
8What type of literary device used in each sentence. Choose the answer from the list provided below.
1. The dog cries like a man.
2. “How could they see anything but the shadows of they were never allowed to move their heads” Plato
3. Ask for her hand.
4. Quincy’s quilters quit quilting quickly.
5. There’s always rainbow after the rain.
6. His job is like pulling a sword out of a stone.
7. Sorry, not sorry.
8. My alarm clock yells at me to get out of bed every morning.
9. In my younger and more vulnerable years my father gave me some advice that I’ve been turning over in my mind ever since. “Whenever you feel like criticizing anyone,” he told me, “Just remember that all the people in this world haven’t had the advantages that you’ve had.
How many zeroes are there after the last non-zero digit of a million? a trillion? To easily identify that, let us make a program to count and print the number of zeroes after the last non-zero digit of a number. For example, in 20400, there are 2 zeroes after the last non-zero digit of the number, 4.
Are you up for this challenge?
Input
A line containing an integer.
20400Output
A line containing an integer.
2I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.
How about that?
Input
A line containing two integers separated by a space.
3·10
Output
Multiple lines containing an integer.
10
8
6
4
Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
print "Fizz" if the number is divisible by 3
print "Buzz" if the number is divisible by 5
print "FizzBuzz" if the number is divisible by both 3 and 5
print the number itself if none of the above conditions are met
Input
A line containing an integer.
15
Output
Multiple lines containing a string or an integer.
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
The average length of time for students to enroll has been 50 minutes. If a random sample of 12 students incurred an average enrolment time of 42 minutes with a standard deviation of 11.9 minutes under a new enrolment system, test the hypothesis that the population mean is now less than 50 using a 0.05 level of significance. Assume that the length of time of the population is normal.
Create a class Person with attributes string Name, string Address and int age and define getter setter method using Auto Implementation Property
• Create a class PersonImplementation and implement the below given methods:
1. GetName(IList<Person> person) display the name and address of all the persons in the List
2. Average(List<Player> players) to calculate the average age of all the persons.
3. Max(IList<Player> players) to find the maximum age of the person.
using zero reference potential at infinity, determine the amount by which point a charge of 8x10-8 c alter the electric potential at point 1.5m away where the charge is positive
A pure sample of S-phenyalanine has a specific rotation of [a] of 70degree If am mixture of two enantiomers of phenylalanine gives a specific rotation of -14.0 degree, what is the percentage of S enantiomer in this mixture?