Program 1:
input code:
output1:
output2:
code:
'''make function for find a bonus'''
def program1():
'''take input from user'''
unit=int(input("Enter number of Units produced:"))
count=0
'''check the validation of Units'''
if(unit<10 or unit>10000):
print("units is not valid.")
count=1
'''if entered value is valid than we find a bonus'''
if(count==0):
'''check bonus conditions'''
if(unit>=10 and unit<=1000):
bonus=25
elif(unit>1000 and unit<=3000):
bonus=50
elif(unit>3000 and unit<=6000):
bonus=100
elif(unit>6000 and unit<=10000):
bonus=200
print("This year's production bonus will be $",bonus)
'''call function'''
program1()
Program 2:
input code:
output1:
output2:
code:
'''declare a constant named'''
named=0.1
'''make function for find a discount'''
def program2():
'''take input from user'''
rate=int(input("Enter current insurance rate:"))
age=int(input("Enter age:"))
accidents=int(input("Enter the number of accidents:"))
count=0
'''check the validation of rate,age and accidents'''
if(rate<0 or rate>3000):
print("Rate is not valid.")
count=1
elif(age<16 or age>90):
print("Age is not valid.")
count=1
elif(accidents>5 or accidents<0):
print("number of accidents is not valid.")
count=1
'''if entered value is valid than we find a discount'''
if(count==0):
'''check discount conditions'''
if(age>30 and accidents<5):
'''calculate discount'''
discount=rate*named
'''print discount'''
print("Congratulations,you are entitled to a $",discount)
print("\nThank you for Driving Safely.")
else:
'''print message'''
print("You do not qualify for a discount at this time.\n\nPlease
remember to Drive Safely")
'''call function'''
program2()
In Python. Complete the following programs. Begin each program with a comment that includes: • Your...
A salesperson also receives a bonus at the end of each month, based on the following criteria: If the salesperson has been with the store for five years or less, the bonus is $10 for each year that he or she has worked there If the salesperson has been with the store for more than five years, the bonus is $20 for each year that he or she has worked there. The salesperson can earn an additional bonus as follows:...
Write a Python (3) program to simulate** a buffer overflow (this is a new script, not part of the intranet assignment), then implement input validation to prevent it. There are two parts to this assignment: 1) The program should display a welcome message and prompt the user for a username. Create a simulated buffer overflow condition by allowing a user to input more data than the size of the allocated memory (causing the program to crash). 2) Implement input validation...
(I would like this to be in five parts.) Write a program (Python module) that includes a function named studentrecords. This function must support execution of two loops. The first loop is to query the user whether they wish to enter additional records or not. It must accept responses of either yes or no as input, regardless of the letter-cases used for individual letters in the response. If the response is not recognized ( it isn’t yes or no) it...
I need help building code in python for this: Create a program that: Creates a sales receipt, displays the receipt entries and totals, and saves the receipt entries to a file Prompt the user to enter the Item Name Item Quantity Item Price Display the item name, the quantity, and item price, and the extended price (Item Quantity multiplied by Item Price) after the entry is made Save the item name, quantity, item price, and extended price to a file...
In C language using printf and scanf statements: Write a program to display a histogram based on a number entered by the user. A histogram is a graphical representation of a number (in our case, using the asterisk character). On the same line after displaying the histogram, display the number. The entire program will repeat until the user enters zero or a negative number. Before the program ends, display "Bye...". The program will ask the user to enter a non-zero...
Python 3.7 to be used. Just a simple design a program that depends on its own. You should also not need to import anything. No code outside of a function! Median List Traversal and Exception Handling Create a menu-driven program that will accept a collection of non-negative integers from the keyboard, calculate the mean and median values and display those values on the screen. Your menu should have 6 options 50% below 50% above Add a number to the list/array...
*In Python please***** This program will display some statistics, a table and a histogram of a set of cities and the population of each city. You will ask the user for all of the information. Using what you learned about incremental development, consider the following approach to create your program: Prompt the user for information about the table. First, ask for the title of this data set by prompting the user for a title for data, and then output the...
In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...
using this code to complete. it python 3.#Display Program Purpose print("The program will show how much money you will make working a job that gives a inputted percentage increase each year") #Declaration and Initialization of Variables userName = "" #Variable to hold user's name currentYear = 0 #Variable to hold current year input birthYear = 0 #Variable to hold birth year input startingSalary = 0 #Variable to hold starting salary input retirementAge = 0 #Variable to hold retirement age input...
Requesting help with the following C Program: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program The program will reuse the DATE struct from the previous assignment. You should also copy in the functions relating to a DATE. The program will create a PAYRECORD struct with the following fields: typedef struct...