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
Helga [31]
2 years ago
15

Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two indivi

dual for a particular year is exactly the same, you should print an error and make the user enter both the salaries again for that year. (The condition is that there salaries should not be the exact same).Your program should accept from the user the salaries for each individual one year at a time. When the user is finished entering the salaries, the program should print which individual made the highest total salary over the 5 year period. This is the individual whose salary is the highest.You have to use arrays and loops in this assignment.In the sample output examples, what the user entered is shownin italics.Welcome to the winning card program.
Enter the salary individual 1 got in year 1>10000
Enter the salary individual 2 got in year 1 >50000
Enter the salary individual 1 got in year 2 >30000
Enter the salary individual 2 got in year 2 >50000
Enter the salary individual 1 got in year 3>35000
Enter the salary individual 2 got in year 3 >105000
Enter the salary individual 1 got in year 4>85000
Enter the salary individual 2 got in year 4 >68000
Enter the salary individual 1 got in year 5>75000
Enter the salary individual 2 got in year 5 >100000
Individual 2 has the highest salary
Computers and Technology
1 answer:
kirza4 [7]2 years ago
4 0

In python:

i = 1

lst1 = ([])

lst2 = ([])

while i <= 5:

   person1 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   person2 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   lst1.append(person1)

   lst2.append(person2)

   i += 1

if sum(lst1) > sum(lst2):

   print("Individual 1 has the highest salary")

else:

   print("Individual 2 has the highest salary")

This works correctly if the two individuals do not end up with the same salary overall.

You might be interested in
What aspects of your life are most influenced by media and technology​
Anastasy [175]

Answer:

Everyday life

Explanation:

Television

office work (computers )

Music

video games

ware house work uses technology

work from home jobs use technology

cellular towers

5 0
3 years ago
The Texas Department of Education has offices throughout the state covering more than 268,000 square miles. State documents are
notka56 [123]

Answer: WAN

Explanation:

3 0
1 year ago
The database cannot be migrated to a different engine because sql server features are used in the application’s net code. The co
Nezavi [6.7K]

Answer:

Explanation:

B is correct

3 0
2 years ago
A function ________ contains the statements that make up the function.
mestny [16]

Answer:

A) definition

Explanation:

3 0
3 years ago
What's the smallest part of a computer
Murljashka [212]

Answer:

A byte

Explanation:

I just had that question on my quiz

7 0
3 years ago
Read 2 more answers
Other questions:
  • Parameter variables should not be changed within the body of a method because _______________. Select one: a. it mixes the conce
    5·1 answer
  • Using Task Manager, you discover an unwanted program that is launched at startup.
    13·1 answer
  • During an interview, your non-verbal communication (body language, gestures, tone of voice, speed of talking,
    6·1 answer
  • Excel assigns the name ____ to the first excel table created in a workbook.
    10·1 answer
  • Dust buildup inside a desktop PC case can be managed effectively by ____.
    7·2 answers
  • Which term means a device that converts one voltage to another?
    13·1 answer
  • I'm gonna get grounded for getting a 52 on my test :(
    13·1 answer
  • Which code must be included to use Turtle Graphics?
    14·2 answers
  • Examples of system software include operating systems like macos, Linux, Android and
    10·2 answers
  • Which of the following are drivers of machine learning growth?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!