Main Program: Start Declare variables idno, location, dept, budget, spent, msg Input idno, location, dept, budget, spent If dept < 20 msg cut 5% Else If budget > 350000 msg = cut 7% Else msg cut 6% End if End if Output idno, location, dept, budget, spent, msg Stop
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: It is recommended to use functions that are specified by the user rather than those that are preset.
A: User-defined functions are a kind of function that may be used inside the body of a policy to…
Q: //The function must return the value indicated in the comments // The calcDiscountPrice function…
A: As given, we need to find out the variable value that needs to be returned from the function.
Q: Why is it necessary to define functions when writing code?
A: Code functions are sections of clean, reusable code that carry out a particular activity. They have…
Q: Function InchesToFeet(float inchesToConvert) returns float totalFeet totalFeet = inchesToConvert /…
A: As the programming language is not mentioned here, so I have given code in JAVA and…
Q: In which of the following qualities the SCRUM development process waterfall, spiral, and iterative…
A: Given question has asked to write a program to check the validity of a book tittle. Valid tittle of…
Q: Write the pseudo-code of Q1 using C++ language supposing that you have the following variables and…
A: Solution:: Q2)
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: Function GetHighestValue(integer value1, integer value2) returns integer result if value1 >…
A: The given code consists of two functions: GetHighestValue and Main.The GetHighestValue function…
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: Decision Structure Problem For this assignment you will do 2 things: Solve the problem with…
A: Actually, pseudocode is an artificial and informal language that helps programmers develop…
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: QUESTION 4 Write a C++ function (not a program), that is passed a positive integer value. The…
A: Given:
Q: What benefits can you get from using a function?
A: Answer: We need to write what is the benefit of using the function . So we will see in the more…
Q: Detect Even/Odd Write a function with no parameters, even_or_odd() in Python Specifications:…
A: To check if a number is even or odd using mod(%) operator. The modulo operator returns the remainder…
Q: 1- printlnfo: This function prints your name and ID to the screen. 2- caleShapeArea: This function…
A: First, we need to display the menu, then we need to read the required input parameters and then…
Q: It is recommended to use functions that are specified by the user rather than those that are preset.
A: User-defined functions are a kind of function that may be used inside the body of a policy to…
Q: Project Description A telephone book system, also known as a telephone directory, telephone address…
A: This implementation defines a Person class to store the details of each person in the phone…
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.
Q: Write a function that takes two positive integers that represent the numerator and denominator of a…
A: We need to write a program to reduce a user defined fraction. The programming language used is…
Q: A value returning function executes its statements and then returns a value. true or false
A: A value-returning function is a function which executes some statements and returns a value usually…
Q: Start Declare variables idno, msg, location, dept budget Input idno, location, dept, budget…
A: Here is the explanation : The program given above is the simple program To ease the process i had…
Q: Given two integers that represent the miles to drive fr following operations
A: For the given problem, below is an implementation of the SimpleCar program in C++.
Step by step
Solved in 3 steps with 1 images
- Function SecondsToMinutes(float totalSecs) returns float resultMins // Calculate resultMins: resultMins = 0 Function Main() returns nothing float userSecs float resultMins userSecs = Get next input resultMins = SecondsToMinutes(userSecs) Put userSecs to output Put " seconds are " to output Put resultMins to output Put " minutes." to outputWhat benefits can you get from using a function?C++
- Assume default declaration types for all variables. Examine the following internal function codes and determine which is correct to return a valid output? options: function ejob (a, b) real, intent(in):: a, b ejob=a/b end function none of the given code choices Real Function ejob (a, b) real, intent(in):: a, b ejob=a/b End function Function ejob (c, b) real ejob real, intent(in):: c, b ejob=c/b end function all the given code choiceser 6 Functions Programming Exercises te 1. Rectangle Area ngle Area The area of a rectangle is calculated according to the following formula: Area = Width X Length Design a function that accepts a rectangle's width and length as arguments and returns the rectangle's area. Use the function in a program that prompts the user to enter the rectangle's width and length, and then displays the rectangle's area.Start Declare variables idno, msg, location, dept budget Input idno, location, dept, budget budgetMsg() Output idno, msg, location, dept, budget Stop msg = cut 3% budget > 500000 What would the results be? Problem #8: 3333 BO 20 600000 Problem #9: 3434 AT 15 400000 Problem #10: 4444 NB 14 700000 budgetMsg() dept> 15 msg = cut4% Return or End module msg = cut 6%
- assign(self, assignment:Assignment) -> AssignmentResult: """ This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment…Program Unit Score Calculator Console App Write a Python Console Application program that allows the user to enter the marks for different assessments in a unit, and computes the total mark and grade for the unit. Here is the program logic specification: There are six assessment activities Quiz1, Quiz2, Quiz3, Quiz4, Lab Journal, Major Assignment and Final Exam. The four quizzes are worth 5 marks each, the Lab Journal is worth 10 marks, the Major Assignment is worth 30 marks and the Final Exam is worth 40 marks. The algorithm for computing the total mark for the unit is: Total Mark = Quiz1+Quiz2+Quiz3+Quiz4+Major Assignment+ Lab Journal + Final Exam The following screenshot shows a successful test run: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