Look at the code and the sample inputs and outputs below to design the program accordingly. 1. Write a class called Color that only adds the 3 primary colors (red, blue and yellow). 2. Write a required constructor for the class. 3. You have to use operator overloading to get the desired outputs as shown. Hint: There will be only one constructor and only one method tackling the addition operation. No other methods are required. Note: Order of the color given as input should not matter. For example, in sample input 1, if the first input was yellow and then red, the output would still be orange. #Write your code here Sample Input 1: First Color: red Second Color: yellow #Do not change the following linoes of code = Color(input("First Color: ").lower() C2 - Color(input("second Color: ").lower()) C3 - C1 + C2 print("Color formed:", C3.cr) Sample Output 1: Color formed: Orange Sample Input 2: First Color: red Second Color: blue Sample Output 2: Color formed: Violet Sample Input 3: First Color: yellow Second Color: BLUE Sample Output 3: Color formed: Green

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
A CSE111 Lab Assignment 5.pdf - G x
+
A drive.google.com/file/d/1jPJtXzYVIcq3kLz3lxQKbARİKYVO-eTWriew
曲 Apps
YouTube M Inbox (218) - ibney.
Dashboard | bux | B.
A CSE111 Lab Assign. C cse260 lab
Co Untitled0.ipynb - C. E Google Docs O Online Courses - Le.
O Dashboard - beecro..
E Reading list
CSE111
MAT110
Phy111 CSE260 A Csel11Book
КМАР
Task 4
Look at the code and the sample inputs and outputs below to design the program
accordingly.
1. Write a class called Color that only adds the 3 primary colors (red, blue and
yellow).
2. Write a required constructor for the class.
3. You have to use operator overloading to get the desired outputs as shown.
Hint:
There will be only one constructor and only one method tackling the addition operation.
No other methods are required.
Note: Order of the color given as input should not matter. For example, in sample input
1, if the first input was yellow and then red, the output would still be orange.
Sample Input 1:
First Color: red
Second Color: yellow
#Write your code here
#Do not change the following lines of code
C1 = Color(input("First Color: ").lower())
C2 = Color(input("Second Color: ").lower())
C3 = C1 + C2
print("Color formed:", C3.clr)
Sample Output 1:
Color formed: Orange
Sample Input 2:
First Color: red
Second Color: blue
Sample Output 2:
Color formed: Violet
Sample Input 3:
First Color: yellow
Second Color: BLUE
Sample Output 3:
Color formed: Green
Activate Windows
Go to Settings to activate Windows.
Page
5 / 9
9:26 PM
P Type here to search
2 4)
11/30/2021
86°F Haze
Transcribed Image Text:A CSE111 Lab Assignment 5.pdf - G x + A drive.google.com/file/d/1jPJtXzYVIcq3kLz3lxQKbARİKYVO-eTWriew 曲 Apps YouTube M Inbox (218) - ibney. Dashboard | bux | B. A CSE111 Lab Assign. C cse260 lab Co Untitled0.ipynb - C. E Google Docs O Online Courses - Le. O Dashboard - beecro.. E Reading list CSE111 MAT110 Phy111 CSE260 A Csel11Book КМАР Task 4 Look at the code and the sample inputs and outputs below to design the program accordingly. 1. Write a class called Color that only adds the 3 primary colors (red, blue and yellow). 2. Write a required constructor for the class. 3. You have to use operator overloading to get the desired outputs as shown. Hint: There will be only one constructor and only one method tackling the addition operation. No other methods are required. Note: Order of the color given as input should not matter. For example, in sample input 1, if the first input was yellow and then red, the output would still be orange. Sample Input 1: First Color: red Second Color: yellow #Write your code here #Do not change the following lines of code C1 = Color(input("First Color: ").lower()) C2 = Color(input("Second Color: ").lower()) C3 = C1 + C2 print("Color formed:", C3.clr) Sample Output 1: Color formed: Orange Sample Input 2: First Color: red Second Color: blue Sample Output 2: Color formed: Violet Sample Input 3: First Color: yellow Second Color: BLUE Sample Output 3: Color formed: Green Activate Windows Go to Settings to activate Windows. Page 5 / 9 9:26 PM P Type here to search 2 4) 11/30/2021 86°F Haze
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY