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
yKpoI14uk [10]
3 years ago
6

Write a program that will input a list of test scores in from the keyboard. When the user enters -1, print the average.

Computers and Technology
2 answers:
never [62]3 years ago
7 0

print("Enter the Scores:")

total = []

while True:

   num = int(input())

   if num == -1:

       break

   total.append(num)

print("The average is:",(sum(total)/len(total)))

I wrote my code in python 3.8. Also, you have to be careful about adding -1 to the total. You don't want to count -1 in the average.

aivan3 [116]3 years ago
3 0

Answer: -1 usually represents infinity.

Explanation:

It would keep going forever and not be able to stop without manually stopping it.

You might be interested in
Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6,
Artyom0805 [142]

Answer:

Explanation:

The following is a python function that has arrays with all the cards available and then uses random to choose a random card from the dictionary. Finally it prints out the card chosen...

import random

def choose_card():

   card = ["Ace", 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King']

   symbols = ['Clubs', 'Diamonds', 'Hearts', 'Spades']

   chosen_card = str(card[random.randint(0, len(card))])

   symbols = symbols[random.randint(0, len(symbols))]

   print("Chosen Card: " + chosen_card + " of " + symbols)

7 0
2 years ago
Using the diagram to the right, match each letter
alexira [117]

Answer:

A - slide

B - ribbon

C- command

D - group

E - format painter

F - tab

Explanation:

edge2020

5 0
2 years ago
When you right-click a spreadsheet object, what command should you select to activate the sheet?
miss Akunina [59]
I would think the answer is C. Hope this helps! :D
5 0
3 years ago
Read 2 more answers
Python Code that predicts the amount of money you will have in your IRA when you retire. Inputs are: 1. Number of years until yo
zaharov [31]

Answer:

yearsUntilRetire =0

expectedInterest =-1.00

initialAmount =-1.0

expectedAmountToAdd = -1.00

while yearsUntilRetire < 1 or yearsUntilRetire > 70:

yearsUntilRetire = int(input("Number of year until you retire between 1 to 70: "))

while expectedInterest <0 :

expectedInterest = float(input("enter the expected rate : "))

if expectedInterest >= 10:

doubleCheckRate = input("do you really expect {} interest rate: ".format(expectedInterest)).lower()

if doubleCheckRate == "false":

expectedInterest =-1.00

while initialAmount < 0:

initialAmount = float(input("Enter positive initial amount for IRA: "))

while expectedAmountToAdd < 0 or expectedAmountToAdd > 2500:

expectedAmountToAdd = float(input("Enter positive IRA amount to be added each year between 0 to $2500: "))

finalContribution =initialAmount

for i in range(yearsUntilRetire):

finalContribution = finalContribution + finalContribution * (expectedInterest/100.00) + expectedAmountToAdd

if (i+1) % 5 == 0:

print("Contribution after year {} is ${:,.2f}.".format(i+1,finalContribution))

 

print("Final Contribution is ${:,.2f}.".format(finalContribution))

Explanation:

  • Use a loop to get the valid input from the user for years until retire between 1 to 70 .
  • Get the valid input for expected rate .
  • Check if expected rate is greater than or equal to 10 then ask the user again if one expect such high rate .
  • Use a loop to get valid IRA initial Contribution .
  • Use a loop to get expected Amount to add regularly in IRA .
  • Iterate over numbers of year and print the data after 5 years .
3 0
3 years ago
A website that allows a company to share information in order to increase customers' know-ledge about its products, create a con
hichkok12 [17]

Answer:

Blog is the correct answer to the following question.

Explanation:

A website that is created to share the information of the companies or the organisations to increase the knowledge of their customers related to the companies services and goods.

In other words, a blog is a type of website but not a full website in which the new content is updated in a daily manner but the nature of the website is the static where the contents is stored in the different pages and also they are not updated in a daily manner.

6 0
3 years ago
Other questions:
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • View the attached pic
    6·2 answers
  • Lewis is using a stylus with his touch screen computer in order to draw a
    8·1 answer
  • You have local administrative rights to your computer running windows 7. you cannot find some of the operating system files on y
    8·1 answer
  • If you were doing a regular expression inside a Linux command line, which special character on the keyboard would give you two p
    13·1 answer
  • A deluxe meal, represented by a DeluxeMeal object, includes a side dish and a drink for an additional cost of $3. The DeluxeMeal
    14·1 answer
  • 22. Which of the following device will you require to hear music on
    5·1 answer
  • How do we “read” and “write” in MAR and MDR memory unit, please help I am very confused :)
    10·1 answer
  • What underlying concept is edge computing based on?
    13·2 answers
  • Read the following characteristic:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!