p-5 P=p%2 if p!=5 or p<=5: print("Engineering Department") else: print("Business Department") What is the output of the above program
Q: - Write a program that takes a first name as the input, and outputs a welcome message to that name.
A: I have done the code using C language.
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: The given c program is to calculate the change. This program prompts the user to enter the value…
Q: our task is to develop a program that can achieve the same kact thing. Bear in mind the following…
A: # include<stdio.h> #include<conio.h> int main() { char operator, name;level;…
Q: Q7: Code a complete Python program that performs the following operations by reading the weight of…
A: # maintain a flag if user enter 0 then value of flag is changed to 0 and loop exit flag = 1# created…
Q: Change Return Program: PYTHON( Just need a description for the **USER** of how it works and how to…
A: Algorithm: 1. Ask for amount 2. Ask for amount paid. 3. Display change in denomination of all US…
Q: #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number…
A: The function getch() defines under <conio.h> header file, include <conio.h> header file…
Q: Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases.…
A: In this question you are asking the modifications to a Java program that counts the number of words…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: #Code: import java.util.Scanner; public class LabProgram { public static void main(String[]…
Q: By default, which one of the following types of values will be thrown when the below function is…
A: The problem is based on the basics of functions in python programming language.
Q: 9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original…
A: #include <iostream>using namespace std; const int LIMIT = 5000; int sumOfDivisors(int); int…
Q: Parking Charges) A parking garage charges a $2.00 minimum fee to park for up to threehours and an…
A: Lets see the solution.
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: The algorithm to calculate the amount of change returned is given below: - Algorithm: - Step1:…
Q: max = value2; %3D int main () int max = 03; %3D maxValue (1, 2, тах); cout << "max is " << max <<…
A:
Q: Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases.…
A: In this question you are asking the modifications to a Java program that counts the number of words…
Q: Nice Number Programming: Nice program ask user to enter three integers from keyboard (java console),…
A: Below is the required java program. Program Approach: Import necessary packages to get the standard…
Q: """ This program will look for the next perfect square. Check the argument to see if it is a perfect…
A: The goal of this program is to find the next perfect square given an input number. The program…
Q: From 1-100 #include Rewrite code given below and correct all errors, the code s from 1-100 after…
A: This is a C program that uses a for loop to print the numbers from 1 to 100. The program starts by…
Q: Please answer item number 3. (pyhthon programming)
A: In the code, after taking input from the user for the marks, these are stored in 3 different…
Q: -Language The goal of this problem is to find the smallest integer in a list of numbers. To help…
A: C is a general-purpose computer programming language.
Q: Static Variable: a variable whose lifetime is the lifetime of the program (static int x;) Dynamic…
A: Given: Static Variable: a variable whose lifetime is the lifetime of the program (static int x;)…
Q: This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being…
A: We need to find correct option(s) regarding given Python code.
Q: Write a program that asks the user to enter the name of the medicine (t for ThroX, f for FeliX), his…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: In a 50-person class, students with grades below 70 are considered unsuccessful. Write an algorithm…
A: Algorithm: Step 1: Start Step 2: Declare grade variable Step 3: Input grade Step 4: if…
Q: def f(x: float) -> int: return int(x) def g(x: str) -> float: return float(x) y = f(g("3.14"))…
A: Answer: Option 3 - y's inferred data type is int Explanation: The given equation is y=f(g("3.14"))…
Q: 4. Execute the program. Your output should be as follows: : TV Stand ice: $325.0 Price: $200.0 125.0…
A: The complete python code is below:
Q: In India McDonald's has the n number of customers and they are famous for their taste and quality so…
A: Given: - The solution as per the given information
Q: /* This program should play a game with the user asking her to guess a target number (randomly…
A: As no programming language is mentioned, it is solved using Java
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 program that uses Euclid's algorithm to determine the greatest common denominator of two…
A: # Python program to determine greatest common denominator of two integers x and y using Euclidean…
Q: What does this function do? def func3(a,b.c): i=c whileți<=b): if(i%a==0): print(i,end=" ") i=i+1 A…
A: Given: To choose the correct option.
Q: ISSUE NEEDED TO BE SOLVED: I attached the error codes that keep presenting themselves with the code…
A: Below is the explanation:
Q: Write a program that randomly generates a lottery between 100 and 999 (random.randint(100, 999)),…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: The following function has errors. Locate as many errors as you can. void getValue(int value&) {…
A: GIVEN: The following function has errors. Locate as many errors as you can. void getValue(int…
Q: Q7-Write a program that simulates a simple calculator. It reads two integers and a character. If the…
A: // Always mention the language of the program, for now, I am doing it in C++ // Code #include…
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: What works: Input works if it is in the range of 5 and 95 included 5 and 95. Input works if it is…
Q: Write code to complete DoublePennies()'s base case. Sample output for below program:Number of…
A: Answer:The condition for finding total pennies is as follows:if(numDays == 0){ totalPennies =…
Q: Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose…
A: To write program to find interest. i used C++ language.
Q: START OF PLAY The player starts with 100 points. They have ten attempts (or rounds) to reach 500…
A: Answer: Python Source Code: import randomprint("--- Welcome to High-Low ---")print("Start with 100…
Q: Write a program that takes in three integers and outputs the largest value. If the input integers…
A: Take in three integers from the user.If all three integers are equal, output the integers'…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps
- Q1. FizzBuzz problem:- Write a program which return "fizz" if the number is a multiplier of 3, return "buzz" if its multiplier of 5 and return "fizzbuzz" if the number is divisible by both 3 and 5. If the number is not divisible by either 3 or 5 then it should just return the number itself? .If..elifC++ code not Java
- Question 2: Grade Calculation Program - designing You will write a python program to compute the final grade of a student in this course. Your program should first ask the student's name and then ask that student for their marks in all six assessment criteria in the following sequence: practice problems, tutorials, assignments, self- evaluations, tests, and final exam. All numbers entered will be a percentage (i.e., out of 100) and can have optional decimal components. Your program must compute the final Point Grade (out of 100) for this student using the correct weight assigned for each assessment criterion. Be sure to read the course outline and Lecture-0 to find the weight distribution. The next step is to convert the final point grade of that student to a letter grade according to the following (simplified) conversion table.¹ Point Grade* [90-100] [80-90) [70-80) [60-70) [50-60) Below 50 Letter Grade A+ A B C D F *A square bracket indicates that the range is inclusive at that end,…Convert totalMeters to hectometers, decameters, and meters, finding the maximum number of hectometers, then decameters, then meters. Ex: If the input is 815, then the output is: Hectometers: 8 Decameters: 1 Meters: 5 Note: A hectometer is 100 meters. A decameter is 10 meters. 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13 14 15 16 17 18 int totalMeters; int numHectometers; int numDecameters; int numMeters; cin >>totalMeters; cout << "Hectometers: cout << "Decameters: cout << "Meters: " << numMeters << endl; " << numHectometers << endl; << numDecameters << endl; 2 3be recor #include #include minutes #include limit on int func(int, int, int, int); main(){ srand(time(NULL)); int a, b, c, fNum; printf("Choose three different numbers between 0-39:"); scanf ("%d%d%d", &a, &b, &c); fNum = func (a, b, c, 25); printf("\nThe result: %d", fNum); } int func (int ul, int u2, int u3, int iter){ srand (time (NULL)); int n1=0, i=0, count=0; for (;iGreatest Common Divisor Two integers A and B have the greatest common divisor which is the largest positive integer that divides A and B, evenly, without a remainder. One way to find the Greatest Common Divisor is to consider the prime factors for A = 372 and B = 84 as shown below. 372 223 * 31 84 22*3*7 GCD (372,84) = 2²*3= 12 In a well-documented Python program, hmwk3Q3.py, query the user for two integers. Use a while-loop to find the remainder R when dividing A by B.Replace the value of A with the value of B and replace the value of B with the value of R.Continue this process within the while-loop until the value of B is zero. At that time the value of A will be the GCD. In a comment, provide the response to your program when A= 98,025,733,547 and B = 2,345,109,894,323.Untitled Section This is a segment of program, when it executed with multiple values for n and s the program displays the value of f, choose which output of f values are wrong answers cin>>x>>y; if (x>1) &&(y<5) {f=x+y*9; else f-x-y-11; } cout<This code when ran asks for job code and then hours worked, but when I put in 20 or 40 hours I get an error... indexerror: Tuple index out of range Its supposed to be for up to 40 hours, no more then that.. how do I fix the tuple range? # Name: Erica Strong # Prog Purpose: This program computes employee weekly pay # Category codes: # C Cashier: $16.50 # S Stocker: $15.75 # J Janitor: $15.75 # M Maintenance: $19.50 import datetime # define pay rates & deduction rates PAY_RATES = (16.50, 15.75, 15.75, 19.50) DEDUCTION_RATES = (0.12, 0.03, 0.062, 0.0145) # define global variables inout = 'C' # C means Cashier, S means Stocker, J means Janitor, M means Maintenance hoursworked= 0 payrates = 0 deductionrates = 0 grosspay = 0 netpay = 0 ############ Define program functions ############ def main(): another_employee = True while another_employee: hours_worked, job_code = get_user_data() gross_pay = perform_calculations(hours_worked, job_code) total_deductions, deductions =…C++ ONLYTomorrow is the closing ceremony for the 2022 World Cup, and Cody and his friends want to know who the top scorer of the tournament is. John and the others insist that it Lionel Messi who is the top-scorer (scoring 10) but Cody, a Ronaldo fan, is stubborn and decided to make a list of all the players who scored goals and order them randomly. He then must look for the highest number and see if that number is higher than Messi’s goals. Input the number of players then input the number of goals scored for each. Print "Not Messi" if the highest goals exceed 10 and "Okay, fine, it's Messi" if it doesn’t.Enter·the·number·of·players:·4 Goals·score·by·player·#1:·7 Goals·score·by·player·#2:·2 Goals·score·by·player·#3:·5 Goals·score·by·player·#4:·1 Okay,·fine,·it's·MessiMad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story. Ex: If the input is: Eric Chipotle 12 cars the output is: Eric went to Chipotle to buy 12 different types of cars. 367012.2549490.qx3zqy7 LAB 2.14.1: LAB: Mad Lib 0/10 ACTIVITY LabProgram.java Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String firstName; String genericLocation; int wholeNumber; String pluralNoun; 4 6 7 8 9 10 11 /* Type your code here. */ 12 System.out.println(firstName + } 13 went to + genericlocation + to buy + wholeNumber + differei 14 15C LANGUAGEA private railway company has just purchased a computer for its new automated reservationssystem. You have been asked to write a program to assign seats on each train of the railway havingonly (capacity: 100 seats). Your program should check whether it is a valid seat number or not.Also print its berth type i.e lower berth, middle berth, upper berth, side lower berth, side upperberth. Furthermore, then print a ticket indicating the person's seat number and whether it’s in the firstclass or economy section of the train. Use a single-subscripted array to represent the seating chartof the train. Initialize all the elements of the array to 0 to indicate that all seats are empty. As eachseat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longeravailable.SEE MORE QUESTIONSRecommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education