Create a program that will compute for the SALARY and BONUS of an employee. If the employee is working for at least 5yrs in the company, the bonus 75 % of the salary. For the employee working below 5 yrs., the bonus is 50% of the salary Use function/modular programming..
Q: Write a stub for the function whose declaration is given next. Do not write a whole program, only…
A: Given: Write a stub for the function whose declaration is given next. Do not write a whole program,…
Q: One lap around a standard high-school running track is exactly 0.25 miles. Write a program that…
A: Programming instruction: Declaring variable. Take input from the user. Call the function which…
Q: In physics, an object that is in motion is said to have kinetic energy. The followingformula can be…
A: Given: In physics, an object that is in motion is said to have kinetic energy. The followingformula…
Q: An integer number is said to be a perfect number if its factors, including 1 (but not the number…
A: Program Approach- Include the essential header files. Declare the functions needed for the program.…
Q: Write a program to gauge the rate of an employee’s raise from the previous year. The program asks…
A: Problem statement: Define hike() that computes and returns the hike percentage It estimates the…
Q: Write a function "DivRemain" that will return both the dividend and the remainder from dividing two…
A: #include <stdio.h> void DivRemain(int one , int two){ int Dividend =0; int Remainder =0;…
Q: Write a function which accepts the user’s first and last name and prints the first name 4 times…
A: Note: The programming language is not mentioned in the question so python programming language is…
Q: Make a program with total change amount as integer input that outputs the change using the fewest…
A: Textual Python Code :- def exact_change(input_val): #input_val = int(input()) if input_val <=…
Q: Write a function named min that accepts two integer values as arguments and returns the value that…
A: Solution :
Q: The function below takes two arguments: a string (name) and an integer (position). Complete the…
A: To solve this problem, we need to define a function print_welcome( ) using def keywords, It takes…
Q: Write a program that inputs a number for day of the week (e.g. 1 for Monday, 2 for Tuesday, …, 7 for…
A: Note: - As the programming language is not mentioned to write the code. So, I am using the python…
Q: Q4: the volume of a cylinder is given by the formula: V=r r2L Where r is the cylinder's radius and L…
A: ALGORITHM:- 1. Take input for radius and length of cylinder. 2. Assign value of π using the sin()…
Q: Write a program to dispense change in a grocery store. Yay, a coin dispenser machine! The user…
A: Here I written code in C for given problem. I hope you like it.
Q: Write a function that will take in a number of weeks and a number of days and return the total…
A: Given:
Q: This question is supposed to be a C++ program: Complete the following function which takes as input…
A: As given, I need to write a C++ program having a function called calculateAge that takes two…
Q: Q4: the volume of a cylinder is given by the formula: V =n r²L Where r is the cylinder's radius and…
A: Types of functions in programming language: 1. Without arguments, no return value 2. Without…
Q: Lewis' invention can determine if the weather is too hot (104°F and above) or too cold (50°F and…
A:
Q: hours
A: Define to_seconds() function to calculate total seconds by converting hour, minute, and seconds to…
Q: Write a function that takes a number and returns the largest digit value in the number. For example,…
A: The python program is written where it takes the input from the user and prints the largest number.…
Q: A weight in pounds can be converted to an equivalent weight in kilograms. Write a function that…
A: The program is written in C language. Please check the source code in the next step.
Q: Write a C program that asks the user to enter an iPhone 6 wholesale cost and its markup percentage.…
A: #include <stdio.h> double retailPrice(double wholesalePrice, double markupPercentage){…
Q: Given an non-negative number taken input from user, create a function which takes this integer as…
A: Modulo(%) operator: The % operator divides a numerator with a denominator and gives remainder as…
Q: Lewis' invention can determine if the weather is too hot (104°F and above) or too cold (50°F and…
A: #include<stdio.h>void HotorCold(float c){float f=(float)9/5*c+32.0;if(f<=50)printf("Weather…
Q: Write the function that returns the number of days he needs to buy the cost of his first car. Jayesh…
A: In this problem, we need to design a program in java programming and show into the above desired…
Q: Write a program that accepts a date in the form “month/day/year” and prints whether or not the date…
A: def main(): date = input("Enter a date in the form mo/dy/year: ") date_list = date.split("/")…
Q: Question 1: Write a program using functions, which can print a rectangle of stars (Asterisks) of…
A: Define the function rectangle to hold the height and width. In main function take the value from the…
Q: Q4: the volume of a cylinder is given by the formula: V =nr²L Where r is the cylinder's radius and L…
A: Since programming language is not mentioned i am doing it in python. def area(radius,length ):…
Q: Pearsall's Pizzeria offers delivery in Bozeman. The total delivery cost is equal to the total cost…
A: Python used to answer this question
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: PROGRAM CODE:…
Q: Write a function days_in_month() that returns the number of days in a month. The function has the…
A: PROGRAM CODE: #include <stdio.h> // include…
Q: Using functions, write a program that will solve the problem: Create a program that will display the…
A: As per the requirement program is completed. Algorithm: Step 1: Write the main() method Step 2: Read…
Q: Write a parameter and return program that will require the user to enter a temperature in Celsius…
A: Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Write a function NumberOfPennies() that returns the total number of pennies given a number of…
A: Program: #include <iostream>using namespace std;int NumberOfPennies(int NumberOfDollars, int…
Q: Given a certain Physics problem create a function(projectilemotion_solver) that would take in the…
A: projectilemotion.py import math# function to calculate range on given v and thetadef Range(v,theta):…
Q: Write a complete program for the following problem: a. Function findNum() receives a variable named…
A: #include <iostream> using namespace std; void findNum(int num){ if(num%2==0) //if num…
Q: In Python: Write a program with total change amount as an integer input that outputs the change…
A: NOTE: - The program prints one coin type per line. Three functions are being used here. def…
Q: rite a function days_in_month() that returns the number of days in a month. The function has the…
A: #include<stdio.h>int days_in_month(int month,int is_leap){ int res=-1; switch(month){…
Q: only python Your program should ask the user to input a number of family members. The program should…
A: Solution: Code: def ask_for_age(): age = int(input('Enter the age of a family member: '))…
Q: Write a program that prompts the user for Cartesian coordinates of two points a1,b1 and a2,b2 and…
A: Below is the required program in C language. Program Approach: Distance formula:…
Q: Create a simple program that calls a function call gradeCalculated, in the main area the user is…
A: Program code: #define a function gradeCalculated def gradeCalculated(score): #if score less than 60…
Q: Create a functional program that can calculate the displacement and velocity of a free-falling body…
A: Program code: #include <iostream> #include <cmath> using namespace std; //define a…
Q: C++ Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If…
A: C++ program: #include <iostream> using namespace std; void PrintPopcornTime(int bagOunces) {…
Q: Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1,…
A: Q: Write function for given definition. (language: python)
Q: pts the user for the radius of a sphere, and calculates and prints the volume of that sphere. Use…
A: Given: Write a complete program that prompts the user for the radius of a sphere, andcalculates and…
Q: A farmer is asking to tell him how many legs can be counted among all his animals.The farmer breeds…
A: - The question is to find the total number of animals after having the number of legs for chicken…
Q: Lewis' invention can determine if the weather is too hot (104°F and above) or too cold (50°F and…
A: Since the programming language is not mentioned, I have coded this using Python 3.
Q: In C++ A carpet company has determined that every 50 square feet of floor coverage will require 6…
A: #include<iostream>using namespace std; bool inputValidate(double);void getInfo(double&,…
Q: A weight in pounds can be converted to an equivalent weight in kilograms. Write a function that…
A: The C code is given below with code and output screenshots
Q: Write a program that will read in the number of liters of gasoline consumed by the user’s car and…
A: Modified Program: #include <iostream>using namespace std; int main(void){const double…
use C++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.JAVA CODE PLEASE Functions With No Parameters and Return Values Practice ll by CodeChum Admin Create a program that has a global integer variable assigned to a value of 1. Then, create a new function named increment that increments the global variable. In the main function, if the current value of the global variable is divisible by 3, print “Cody!”. Otherwise, print the value of that global variable. Repeatedly call the increment function until the value of the global variable is greater than 15. Output Multiple lines containing a string or an integer 1 2 Cody! 4 5 Cody! 7 8 Cody! 10 11 Cody! 13 14 Cody! Score:Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline. Remember that print() automatically adds a newline.Sample output with input: 742 seconds ''' Your solution goes here ''' user_ounces = int(input())print_popcorn_time(user_ounces)
- Survey Data Analysis Computers are commonly used to compile and analyze the results of surveys and opinion polls. For this problem, there is a maximum of 30 responses for the survey. Each response is a number from 1 to 9. The program computes for the mean, median and mode of the 30 values. Mean - arithmetic average Median - middle value Mode - value that occurs most frequently The following are some of the function declarations that will be used by the program. Implement them. void initialize(int answer[], int size); initializes the array by inputting values float mean(int answer[],int size); computes for the average int max(int answer[],int size); returns the highest value int min(int answer[], int size); - returns the smallest value int range(int answer[],int size); returns the range of the highest and smallest values Provide the main that includes the creation of the array and tests of the operations.python Define stubs for the functions get_user_num() and compute_avg(). Each stub should print "FIXME: Finish function_name()" followed by a newline, and should return -1. Each stub must also contain the function's parameters.Sample output with two calls to get_user_num() and one call to compute_avg():FIXME: Finish get_user_num() FIXME: Finish get_user_num() FIXME: Finish compute_avg() Avg: -1 i keep getting errors on this onecost1 = 15 cost2 = 20 def sumCart(): totalCost = cost1 + cost2 print (totalCost) sumCart() Modify the program so that it incorporates the following reqiuirements: #1. cost1 and cost2 have values entered by the user #2. The program continuosly loops until the user no longer wants the program to run #3. Add another function of your choice that can enhance or improve the program above
- Functions with No Parameters ArtShow.py 2 ArtShow.py - This program determines if an art show attendee gets a Summary 5% discount for preregistering. 4 Input: Interactive. In this lab, you complete a partially prewritten Python program that includes a function 5 Output: A statement telling the user if they get a discount or no discount. with no parameters. 7 The program asks the user if they have preregistered for art show tickets. If the user 8 # Write discount function here. 9. has preregistered, the program should call a function named discount() that 10 displays the message "You are preregistered and qualify for a 5% discount." If the 11 # Write noDiscount function here. user has not preregistered, the program should call a function named noDiscount () 12 that displays the message "Sorry, you did not preregister and do not qualify for a 13 if -_name__ == '__main__': 5% discount." 14 registerString = input("Did you preregister? Enter Y or N: ") 15 16 # Test input here. If Y, call…Python XYZ store plans to give a festival discount to its customers. The store management has decided to give discount on the following criteria: Shopping Amount Discount Offered >=500 and <1000 5% >=1000 and <2000 8% >=2000 10% An additional discount of 5% is given to customers who are the members of the store. Create a program using user defined function that accepts the shopping amount as a parameter and calculates discount and net amount payable on the basis of the following conditions:Net Payable Amount = Total Shopping Amount – Discount.Convert radians into degrees Write a function in Python that accepts one numeric parameter. This parameter will be the measure of an angle in radians. The function should convert the radians into degrees and then return that value.
- Ibra Bakery wants you to create a simple python program for calculating cashback offers on cakes for the customers on the occasion of their second anniversary. The program should start by reading customer_name, Number_of_cakes. Then you need to do the following Create a void function and a parameter that will display “Welcome to Ibra bakery <customer name>”. example: Welcome to Ibra bakery Mohammed Create a function with return value and with a parameter Number_of_cakes. then input cake_price of each cake. Then calculate Total_price as sum of all the cakes’ prices. Create a function that will accept Total_price as parameter then compute cashback based on a criterion that if Total_price is more than 10.0 omr, cashback will be 20% of Total_price otherwise no cashback. Display all the details as output. User-defined function (python)JAVA CODE PLEASE Recursive Functions Practice ll by CodeChum Admin Create a recursive function named factorial that accepts an integer input as a parameter. This calculates the factorial of that integer through recursion and return it. In the main function, call the factorial function and assign the value to a variable. Print the value in the next line. Input 1. One line containing an integer Output Enter·a·number:·4 24Python onlyYour program should ask the user to input a number of family members. The program should then repeatedly ask the user to input the age of a family member until the specified number of family members is reached. Finally, the program should output the average age of the family members based on the input values. If the user inputs zero for the number of family members, the program should output a friendly message informing the user that at least 1 family member is required. A function has already been defined for you which asks the user for the age of a family member. You must use this function as part of your solution. Your solution must be implemented using a for loop on a range.add on to this: def ask_for_age(): age = int(input('Enter the age of a family member: ')) return age number = int(input('Number of family members: ')) # Write your solution here