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
weeeeeb [17]
3 years ago
6

1.1. (30 points) Write a program to calculate the average number of cars sold by a car agency over a period of years for the fir

st six months of each year. First, the program will ask for the number of years. Then, the program will ask for the number of cars sold for the first six months for the first year. Similarly, the program will repeat asking for the number of cars sold for the first six months of all the remaining years. After all the iterations, the program should display the number of months, the total number of cars sold, and the average number of cars sold per month for the entire period.
Computers and Technology
1 answer:
mario62 [17]3 years ago
8 0

Answer:

count = 0

months = 0

years = int(input("Enter the number of years: "))

for year in range(1, years+1):

   cars_sold = int(input("Enter the number of cars sold in first six months: "))

   count += cars_sold

   months += 6

print("Number of months: " + str(months))

print("Number of cars sold in total: " + str(count))

print("Average number of cars sold per month: " + str(count / months))

Explanation:

Initialize the variables

Ask the user for the number of years

Create a for loop that iterates depending on the given number of years

Ask the user for the number of cars sold in the first six months of the year

Increment the count by given number and increment the months by 6 after each iteration

Print the months, count and, average

You might be interested in
Refer to the image below. The portion of the letter labeled 5. is the ___________________
Salsk061 [2.6K]

Refer to the image below.

WHERE IS THE IMAGE!!!!

6 0
3 years ago
Read 2 more answers
What are the two main functions of user accounts in Active Directory? (Choose all that apply.) Allow users to access resources m
irina [24]

Answer:

method for user authentication to the network

Provide detailed information about a user

Explanation:

An in AD, a user account consists of all the information that includes user names, passwords, and groups. All these information defines a domain user in which a user account has membership access to. With the advanced features of Kerbos, mutual authentication in user accounts to a service is achieved.

3 0
3 years ago
Read 2 more answers
Which statement is true about the storage media?
Ksivusya [100]

The statement which is true about storage media is "Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks."

The cache memory is faster than both SDDs and HDDs. In mathematical terms, it is 4 time faster than SSDs and 80 times faster than HDDs. Moreover, it is more expensive then the SSDs and HDDs storage. Practically speaking, it is not good to have as much in-memory storage as persistent block storage on SSDs or HDDs.

The remaining statements are incorrect such as "Cost per bit in SSDs is lower than that of a Magnetic tapes". While truth be told the SSD cost more than the Magnetic Tapes.

Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time. The statement is also incorrect as SSD are much faster than Magnetic Disk Storage.

Learn more in: brainly.com/question/25026748

8 0
3 years ago
In Excel you insert a comment in a worksheet by using the ____ tab on the Ribbon.
White raven [17]
Review
(I was suprised too)
3 0
4 years ago
Optimal page replacement ______.A. is the page-replacement algorithm most often implementedB. is used mostly for comparison with
deff fn [24]

Answer:

A. Is the page-replacement algorithm most often implemented.

Explanation:

This algorithm is used when a page that is not present in memory is called, leading to the Operating System to replace one of the existing pages with the needed one. There are different replacing algorithms in order to decide which page will be replaced.

This algorithm is implemented to reduce the number of failures and provide a better funcionality and speed the process by discarding pages that won't be used for a long period of time.

8 0
4 years ago
Other questions:
  • Write the printitem() method for the base class. sample output for below program: last name: smith first and last name: bill jon
    6·2 answers
  • What are some innovations that a cell phone has undergone since its original invention?
    14·1 answer
  • You are a cleared employee. You discovered fraud and waste of money related to a classified program within your agency. If you r
    9·1 answer
  • A _____________ is a method of controlled entry into a facility and provides access to secure areas such as a research lab or da
    6·1 answer
  • What is interest? How does interest affect credit card purchases?
    11·1 answer
  • If you want to code a method that can only be called from the class that the method is in, you code ____________________ as the
    15·2 answers
  • Fill in the blanks:
    6·1 answer
  • Microsoft PowerPoint is popular software that allows you tocreate slides, handouts, notes, and outlines.
    12·1 answer
  • Administrators who are wary of using the same tools that attackers use should remember that a tool that can help close an open o
    6·1 answer
  • What is Automation ? Please give an example ?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!