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]
3 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]3 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
For C++ (please make sure it runs properly)
Jlenok [28]

Answer:

The C code is below.

Explanation:

#define amplitude 1

02     #define b 1

03     #define c 200

04     class Sinewave

05     {

06     protected:

07

08                 double freq;

09                 int y;

10

11     public:

12                 Sinewave()

13                 {

14

15                 }              

16                 void generateSinewave()

17                 {

18                     COLORREF yellow = RGB(255,255,0);

19                     COLORREF lightblue = RGB(173,216,230);

20

21                     // make sure the names match

22                     SetConsoleTitle(L"ConGraphics");

23                     HWND hWnd = FindWindow(NULL, L"ConGraphics");

24                     HDC hDC = GetDC(hWnd);

25

26                     //for(int x = 0; x < freq; x++)

27                     for(int x = 0;; x++)

28                     {

29                         // center at y = 200 pixels

30                          

31                         y = amplitude*(int)(sin(x/100.0)*100 + 150);

32                         SetPixel(hDC, x, y, lightblue);

33                          

34                          

35                     }

36                      

37                 }

38 };

7 0
3 years ago
How many grams are in 100 pounds?
stepan [7]

Answer:

45359.2 grams are in 100 pounds

Explanation:

Hope this helped, Have a Wonderful Day!!

3 0
3 years ago
Read 2 more answers
Which is true about routers and switches?
Julli [10]

Answer:

Routers control traffic between networks while switches control traffic within a network

Explanation:

There are different devices involves in computer networking. These devices include hub, switch, router and other components.

Switch is used to connect the computer with in the network. It controls the traffic between different computers within the network. Different computers are connected with each other through different cables with the help of switch.

On the other hand, different LAN's connected through the cable with a router to communicate with each other. This device is used to control the traffic between different networks.

 

8 0
3 years ago
Write a method that draws a circle and a square that is centered in a DrawingPanel. The method will take in the width and height
Katarina [22]

Answer:

public static void drawGraphics (Graphics g, int width, int height) {

   int r = Math.round(width/2);

   int x = 45;

   int y = 30;

     g.setColor(Color.RED);

   g.fillRect(x, y, width, height);

   g.setColor(Color.BLUE);

   g.fillOval(Math.round(x/2), Math.round(y/2), r, r);

}

Explanation:

The Java method "drawGraphics" of the Graphics class accepts draws a square with the "fillRect()" method of the Graphics class object and at its center, a circular path is drawn as well.

3 0
3 years ago
Which of these is NOT a benefit of trade?
Natasha_Volkova [10]

Answer:

<em>Creation of Dependencies</em> is not the only benefit of trade in the list.

Explanation:

People can provide the access to their resource with the help of trading, it will also increase the satisfaction of customer as he will be able to buy the product of his own choice with satisfactory price, as it breaks the monopoly of local producers.

There many disadvantages of the trade, such as it will create dependencies on other countries and local producers not be able to produce that products, this will lead to increase in imports and will increase the trade deficit of the country.

8 0
4 years ago
Other questions:
  • Identify four basic data manipulations performed on a relational database using sql
    7·1 answer
  • Please find one organization that has recently adopted virtualization and summarize their reasons for taking this approach. What
    12·1 answer
  • Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
    6·1 answer
  • 2.<br> The force of impact is
    5·1 answer
  • How does porter’s competitive forces model help companies develop competitive strategies using information systems?
    13·1 answer
  • ……………………is one of the most popular cloud storage facilities.​
    11·1 answer
  • Which of the following statements about content-based filtering is TRUE?
    9·1 answer
  • What is game development​
    10·2 answers
  • Pls answer dis question when i'm not connected and i open bluestacks 5 it will be working but if i am connected it wil not work
    14·1 answer
  • View the contents of the /root/.bash_profile file. type cat /root/.bash_profile at the prompt to answer the question. what is th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!