CODE1:
OUTPUT1:
Raw_Code1:
color1=input("Enter the First primary
color:").lower() #taking two colors as input
color2=input("Enter the Second primary color:").lower()
if(color1=='red' and color2=='blue') or (color1=='blue' and
color2=='red'):
print("When you mix red and blue,you get
purple") #checking required
conditions
elif(color1=='red' and color2=='yellow') or (color1=='yellow' and
color2=='red'):
print("When you mix red and yellow,you get
orange")
elif(color1=='blue' and color2=='yellow') or (color1=='yellow' and
color2=='blue'):
print("When you mix blue and yellow you get
green")
else: #printing error message if he enters color other
than primary
print("You have entered a color other than primary
color")
CODE2:
OUTPUT2:
Raw_Code2:
length1 = int(input("Enter length of 1'st rectangle:"))
#taking two rectangels length and width as inputs
width1 = int(input("Enter width of 1'st rectangle:"))
length2 = int(input("Enter length of 2'st rectangle:"))
width2 = int(input("Enter width of 2'st rectangle:"))
area_of_rect1=length1*width1
area_of_rect2=length2*width2
#calculating area of two rectangles
if(area_of_rect1>area_of_rect2):
#checking if rectangle 1 is greater
print("The Rectangle 1 has greater area")
elif(area_of_rect2>area_of_rect1): #checking if
rectange 2 is greater
print("The Rectangle 2 has greater area")
else:
#checking if they both are
same
print("Both has Equal Areas")
CODE3:
OUTPUT3:
Raw_Code3:
num_of_books=int(input("Enter NUmber of books you
purchased this month:"))
#Taking number of books as input
if(num_of_books==0):
print("You have Earned 0 points")
elif(num_of_books==2): #checking
Required Conditions
print("You have Earned 5 points")
elif(num_of_books==4):
print("You have Earned 15 points")
elif(num_of_books==6):
print("You have Earned 30 points")
elif(num_of_books>=8):
print("You have Earned 60 points")
****Comment me in the Comment box for any Queries******
Directions: Complete all the three programming assignments below. Please be sure to follow the programming rubric...
Python problem: 1. The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown here: When you mix red and blue, you get purple. When you mix red and yellow, you get orange. When you mix blue and yellow, you get green. Create a text file with the names of two colors in it. Write a program...
Python 11. Book Club Points Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases 0 books, he or she earns 0 points If a customer purchases 2 books, he or she earns 5 points. O If a customer purchases 4 books, he or she earns 15 points If a customer purchases 6 books, he or she earns 30...
Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases no books, he or she earns 0 points. If a customer purchases 1 book, he or she earns 5 points. If a customer purchases 2 book, he or she earns 15 points. If a customer purchases 3 book, he or she earns...
Code in c++ please Q1: Software Sales A software company sells a package that retails for $99. Quantity discounts are given according to the following table: QuantityDiscount 10-19 20-49 50-99 100 or more 20% 30% 40% 50% : Write a program that asks for the number of units sold and computes the total cost of the purchase. Input validation: Make sure the number of units is greater than 0. Q2: Book Club Points Community Booksellers has a book club that...
Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit Circles – User inputs position, radius, and color. The position is the CENTER of the circle Rectangles – User inputs position, height, width, color. The position is the lower left-hand corner Colors – Allow red, yellow, blue, and green only Remove – Show the number of items in the list and let the user enter...
please solve the Program USING MATLAB. do not do #2. write in details for the command lines. Make sure the program runs and also completely does what it askes please Write a Matlab program that displays on the screen checkerboard patterns comprising of two alternating_colors to be selected by the user. Your program MUST use as the checkerboard unit pattern a SQUARE INSCRIBED INSIDE A CIRCLE with unit pattern width and checkerboard dimension also to be inputted by the user....
GUI in java: Run the below code before doing the actionlistener: import java.awt.*; import javax.swing.*; public class DrawingFrame extends JFrame { JButton loadButton, saveButton, drawButton; JComboBox colorList, shapesList; JTextField parametersTextField; DrawingFrame() { super("Drawing Application"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JToolBar toolbar = new JToolBar(); toolbar.setRollover(true); toolbar.add(loadButton=new JButton("Load")); toolbar.add(saveButton=new JButton("Save")); toolbar.addSeparator(); toolbar.add(drawButton=new JButton("Draw")); toolbar.addSeparator(); toolbar.addSeparator(); toolbar.add(new...
this is for java programming Please Use Comments I am not 100% sure if my code needs work, this code is for the geometric if you feel like you need to edit it please do :) Problem Description: Modify the GeometricObject class to implement the Comparable interface and define a static max method in the GeometricObject class for finding the larger (in area) of two GeometricObject objects. Draw the UML and implement the new GeometricObject class and its two subclasses...
This is Python programming to develop a multithread program. Please follow the step below. 1. You need to develop a multithread program in Python to simulate a checkout in supermarket. The process of simulation will last for T1 seconds. You do not need to consider thread safety. 2. An integer sequence t is used to record the remaining waiting time for each customer. 3. One thread which runs every one second is used to simulate the processing of the checkout....