Main Program: Start Declare variables idno, location, dept, budget, spent, msg Input idno, location, dept, budget, spent budgetMsg () Output idno, location, dept, budget, spent, msg Stop budgetMsg () If dept < 20 If budget > 350000 msg cut 7% Else Else If spent > 250000 msg cut 6% Else End if msg= cut 5% End if End if msg cut 4% Problem #27: 1111 BO 21 400000 300000 Problem #27: 2222 PR 19 100000 110000 Problem #29: 3333 FR 10 300000 275000 Problem #30 4444 NB 15 200000 150000 What are the results?
Q: cost1 = 15 cost2 = 20 def sumCart(): totalCost = cost1 + cost2 print (totalCost)…
A: The modified python code (with explanation and sample output) to meet the given requirements is…
Q: Start Declare variables idno, namez, paycode payhr, hourswk, salary pay, payafter Input idno, namez,…
A: The outputs of the problem #3 and #4 are explained below Also a Python code is given for your…
Q: The keyword_______ is used in a function header to indicate that a function does not return a value…
A: Correct answer:- Void
Q: Write a multiple assignment statement that can be used instead of the followinggroup of assignment…
A: GIVEN: Write a multiple assignment statement that can be used instead of the followinggroup of…
Q: Function: This program determines if a student will be admitted or rejected. Input: Interactive…
A: Required: Function: This program determines if a student will be admitted or rejected. Input:…
Q: /* Program Name: BadDate.cpp Function: This program determines if a date entered by the user is…
A: Required C++ code according to sample code provided given below :
Q: c++ plz include explanation in // format . thnx
A: #include<iostream>#include<fstream> //include fstream for file IO using namespace std;…
Q: #include <stdio.h>#include <stdlib.h> //declaring variables globally to calculate…
A: Test cases: Test cases are the conditions or variables which must be tested to determine whether…
Q: Write a program ShippingCharges.cpp that asks for the weight of the package and the distance it is…
A: Use an if else structure to validate the values and then use if else if ladder to calculate amount
Q: Test Average and Grade Write a program that asks the user to enter five test scores. The program…
A: An algorithm A complete Python Program (including documentation) Output
Q: Chapter 5 programming exercise 5
A: Note : I have answered the exercise 5 only as asked in the questionIn this Python program, we are…
Q: IPO charts provide only brief descriptions of a function’s input, processing, and output, but do not…
A: Given:- IPO charts provide only brief descriptions of a function’s input, processing, and output,but…
Q: Write a function that takes a plant's name as an argument and returns its growth cycle
A: This is very simple. I have written the full solution code in python for the problem. I have also…
Q: Project 4-4: Sales Tax Calculator Create a program that uses a separate module to calculate sales…
A: ANSWER:-
Q: PEP/9 ASSEMBLY LANGUAGE Modify the following program so that it will read in and average four exam…
A: Procedure followed: Instead of 2 variables, 4 local variables are defined with .EQUATE to store…
Q: # Main function def main(): # Initialize a local variable num=0 # Get a number…
A: Python code to check and print the prime number num=int(input("Enter an integer: ")) if num > 1:…
Q: displaylnfo (purchase, payment) Sample outputs from Homework #6 Part 2 HOMEWORK #6 PART 2 ** Vending…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: 1 function safeTemperature = CheckTemperature(foodTemperature) 2 % foodTemperature: Temperature…
A: function safeTemperature = CheckTemperature(foodTemperature) % 0 indicates food is not at a safe…
Q: Medication dosage by weight A machine administers medication dosage based on weight. Write an…
A: According to the question given:- we have to create program for Medication dosage by weight For that…
Q: Declaration of variables shares - 2000 shareBuy - 40 shareSell - 42.75 brokerRate - 0.03 SProcessing…
A: Introduction of Flow Chart: A flow chart is a pictorial representation of any task or program. It…
Q: 1 def charge_on(knights): if (knights == 5): 1234567 7 Function Calls: charge_on(40) charge_on(5)…
A: 1) The function charge_on takes an integer parameter knights and returns different strings based on…
Q: Function Name: compliments Parameters: answer1 - a boolean (True or False) representing whether the…
A: Solution:The following function displays the outputs as string of compliments.
Step by step
Solved in 3 steps
- H1. A value returning function executes its statements and then returns a value. true or false Explain with details also explain wrong optionC++Driving costs - functions Learning Objectives Create a function to match the specifications Use floating-point value division Instructions Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print(f'{your_value:.2f}') Ex: If the input to your program is: 20.0 3.1599 the output is: The gas cost for 10 miles is $1.58 The gas cost for 50 miles is $7.90 The gas cost for 400 miles is $63.20 Your program must define and call the driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should…
- C#Create a Flowchart: # User defined function for logic OR# The function takes two parameters and returns a single intdef OR(a: int, b: int)->int: # If a is equal to 1 return 1 if a == 1 : return 1 # If b is equal to 1 return 1 elif b == 1 : return 1 # If a and b is equal to 0 return 0 else : return 0 # User defined function for logic NOR# The function takes two parameters and returns a single intdef NOR(a: int, b: int)->int: # If a is equal to 0 and b is also equal to 0 return 1 if a == 0 and b == 0 : return 1 # If a is equal to 0 and b is equal to 1 return 0 elif a == 0 and b == 1 : return 0 # If a is equal to 1 and b is also equal to 0 return 0 elif a == 1 and b == 0 : return 0 # If a is equal to 1 and b is also equal to 1 return 0 elif a == 1 and b == 1 : return 0 # User defined function for logic AND# The function takes two parameters and returns a single intdef AND(a: int, b:…C++
- Process Scheduling: Select all statements below that are true The waiting time is included in the turnaround time. In interactive systems, short response times are unimportant. The time taken in an interactive program from the issuance of a command to the commencement of a response to that command is known as the response time. The response time is the time required for a particular process to complete, from submission time to completion. Throughput is the number of processes executed per time unit. The concept of virtual (run)time in the Completely Fair Scheduler is used to ensure fairness in the allocation of processor capacity.Identify one example of each of the following in the program below. # csC104 def find_discount (amount, rate) : d = amount * rate / 100 return d percent 10 total = num items * price if total > 100: discount = find discount (total, percent) total = total discount print('Your total is', total) + Ipercent 10 1. function name +(total, percent) 2. output statement 3. condition + ]total > 100 4. comment - + # CSC 104 5. argument - +find discount 6. assignment statement + print ('Your total is ', total) 7. variable (amount, rate) 8. parameter 9. string literal - + 'Your total is' 10. relational operator - + discountCalling a function is also called ____ a function. Group of answer choices casting initializing invoking delegating
- Problem Statement The barcode used by the U.S. Postal System to route mail is defined as follows: Each decimal digit in the ZIP code is encoded using a sequence of three half-height and two full-height bars. The barcode starts and ends with a full-height bar (the guard rail) and includes a checksum digit (after the five-digit ZIP code or ZIP + 4), computed by summing up the original digits modulo 10. Define the following functions: Draw a half-height or full-height bar on stddraw. Given a digit, draw its sequence of bars. Compute the checksum digit. Also define global code that read in a five- (or nine-) digit ZIP code as the command-line argument and draws the corresponding postal barcode.Logical variables: On Time or Delayed? Complete the function WhatlsIt such that: The output logical variable on Time is true only if no Traffic is true and gasEmpty is false. The output logical variable delayed is false only if no Traffic is true and gasEmpty is false. Restriction: Logical expressions must be used. Do not use if statements. Function > 1 function [onTime, delayed] = WhatIsIt (noTraffic, gasEmpty) 2 onTime = 3 delayed = 4 5 end Save C Reset MATLAB Documentation