Write a program that asks the user for 8 numbers (you can use a for or...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user for 8 numbers (you can use a for or while loop), compute the sum and track the number of positive entries. Finally, report the sum and the number of positive entries. Output: Enter a number (1 of 8): 2 Enter a number (2 of 8): 4 Enter a number (3 of 8): 6 Enter a number (4 of 8): 8 Enter a number (5 of 8): 10 Enter a number (6 of 8): 12 Enter a number (7 of 8): -5 Enter a number (8 of 8): -6 There were 6 positives, and the sum is 31 Write a program that asks the user for 8 numbers (you can use a for or while loop), compute the sum and track the number of positive entries. Finally, report the sum and the number of positive entries. Output: Enter a number (1 of 8): 2 Enter a number (2 of 8): 4 Enter a number (3 of 8): 6 Enter a number (4 of 8): 8 Enter a number (5 of 8): 10 Enter a number (6 of 8): 12 Enter a number (7 of 8): -5 Enter a number (8 of 8): -6 There were 6 positives, and the sum is 31 Write a program that asks the user for 8 numbers (you can use a for or while loop), compute the sum and track the number of positive entries. Finally, report the sum and the number of positive entries. Output: Enter a number (1 of 8): 2 Enter a number (2 of 8): 4 Enter a number (3 of 8): 6 Enter a number (4 of 8): 8 Enter a number (5 of 8): 10 Enter a number (6 of 8): 12 Enter a number (7 of 8): -5 Enter a number (8 of 8): -6 There were 6 positives, and the sum is 31
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that accomplishes the task python sumofnumbers 0 posi... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these programming questions
-
Factor out the negative sign with the GCF from the below polynomial. -12x^(3)+36x^(2)
-
Terrance is a 13-year-old 8th grader, who is an average student. He is rarely ever disruptive in class and gets along well with his peers. His teacher always noticed that he was normally high-strung,...
-
Refer to Gildan Activewear Inc.'s (Gildan's) financial statements in Appendix A at the end of this book and on MyAccountingLab, and answer the following questions. 1. With respect to manufacturing...
-
Find the inverse by GaussJordan (or by (4*) if n = 2). Check by using (1).
-
Develop the appropriate primary research question to be associated with this design. Develop a hypothetical research scenario that would necessitate the use of the Action Research Approach and a...
-
The CitruSun Corporation ships frozen orange juice concentrate from processing plants in Eustis and Clermont to distributors in Miami, Orlando, and Tallahassee. Each plant can produce 20 tons of...
-
Explain how a company uses a database management system to manage data collection, manipulate data and realize benefits from usage of a database management system.?
-
Services to persons or entities that are requested by a third party require ______. a) Clarification of the nature of the relationship with each party, use of services, and limits to confidentiality...
-
In 8- bit R-2R ladder type DAC module, if the applied digital value is 11001010, calculate the corresponding output voltage. (Assume the suitable value of R and R f ). What is the resolution of this...
-
Explain fully how a medical facility would consider how we greet new staff. In addition, how we do mental health screenings on all employees.
-
List the two major reasons people tune out when listening and why they can cause people to tune out.
-
In a triangle ABC, the measure of angle B is 3 times the measure of angle A, and the measure of angle C is 12 less than 6 times the measure of angle A Find the measure of the angles. The measure of...
-
what are our thoughts from the perspective of human resources professional around what potentially is happening in the same employee getting terminated four times? Expain
-
Describe the parts of the Ethical Principles and Code of Conduct you expect to relate directly to your future career. Include the section numbers of the details of the code you discuss.
-
From the question 1, given P(D|M) = P(M|D)P(D) , solve the following p(M) a. Draw the probability tree for the situation. b. Draw the reverse tree for the situation. c. Discuss the False Positive...
-
Match each of the key terms with the definition that best fits it. _______________ A record of the sequence of data entries and the date of those entries. Here are the key terms from the chapter. The...
-
What is a LAN?
-
How can you get more information from the same amount of data by using a database approach instead of a non-database approach?
-
The management of Colonial Adventure Tours wants to upgrade its database and wants you to help select a different DBMS. To help management, they would like you to complete the following exercises....
-
A blender does 5000 J of work on the food in its bowl. During the time the blender runs, 2000 J of heat is transferred from the warm food to the cooler environment. What is the change in the thermal...
-
Which system contains more atoms: 5 mol of helium (A = 4) or 1 mol of neon (A = 20)? A. Helium B. Neon C. They have the same number of atoms.
-
A sample of ideal gas is in a sealed container. The temperature of the gas and the volume of the container are both increased. What other properties of the gas necessarily change? (More than one...
Study smarter with the SolutionInn App