日if _main name main() e def main(): first= input("Enter your first name:") last= input ("Enter yout last name:") current_annual_salary= float(input("Enter your current annual salary")) print(str("New salary for", first + last, ":", current_annual_salary) 20 23 def new(): if current < 40000: below 4k= current + (current .05) else: above 4k= 2000 + ((-02 current_annual_salary) + current_annual_salary %23 main()
Q: (Financial application: payroll) Write a program that reads the following infor- mation and prints a…
A: CODE:- # Get the employee's namename = input("Enter employee's name: ")# Get the number of hours…
Q: Python: On-line Grocery Shopping Use grocery py in Canvas to start your program. It contains two…
A: Answer: Code: food = ["tomato_soup", "cheese", "sauce", "chicken"] stock = {"tomato_soup": 20,…
Q: write the psuedocode and drow the flowchart Create a program to enter grades and calculate averages…
A: In this question it asked to give the pseudocode and draw a flowchart. The question needs to create…
Q: Pseudocode for the student grade calculator program, please Create a program to enter grades and…
A: Given that, Create a program to enter grades and calculate averages and letter grades. Need a class…
Q: def get_volume (width, height, length=2): volume = width * height * length return volume def main…
A: def get_volume (width , height , length=2): volume = width * height *length return…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: , Reorite the following Pr he syntactical error(s) (if any). Underline cach correction, include…
A: here we can rewrite the program after removing the syntactical error present in the program and…
Q: 1. The circle has two data members, a Point representing the center of the circle and a float value…
A: #include<stdio.h>#include<math.h> typedef struct{ float x; float y;}Point; typedef…
Q: Question 1 Create a VB.NET Console Application that does the following: Create a variable of Integer…
A: Module VBModule Sub Main() Dim marks as integer' to declare marks as integer Dim grade as…
Q: In Java scripts A number is called a Disarium when the sum of its digits in their respective order…
A: Algorithm - create a new method with one argument n. Now create a variable to store the number and…
Q: create a prog that will compute the final grade for a certain student and will display the final…
A: In this program, the C++ programming language is used which is object-oriented programming and also…
Q: 15. Overloaded Hospital Write a program that computes and displays the charges for a patient's…
A: Required:
Q: //Below is the starting code for this homework assignment// #include struct employees {…
A: To take input in the readEmployee function we use the arrow operator to take the input (->) It…
Q: Employee's first name: Kim Employee's last name: Smith Number of shifts: 25 Number of transactions:…
A: #include<iostream> #include<string> using namespace std; int main(){ // Declare and…
Q: Write a program that calculates your grade in this class based on weights for each category and…
A: Algorithm Start Recieve input score from user for reading assignment and assign it to a variable(…
Q: A shop collects the following information from its customers: 1. Full name (first name, last name,…
A: Create a C program for a Coffee shop business. The system can do the following task and the…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: Develop a C# application that inputs one salesperson’s items sold for the last week, then calculates…
A: Hello Student. Warm welcome from my side. Hope you are doing great . I will try my best to answer…
Q: struct ID { int x; int y; }; struct name { ID r; }; int main() { name a[2]; for (int i=0;i<2;i++) {…
A: Given code is struct ID { int x; int y; }; struct name {ID r; }; int main() { name a[2]; for(int…
Q: // Add to this partially built code // fill in code where there is a TODO #include using namespace…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: Code an application that determines how many gallons of water is needed for a pool. Create Void…
A: The program calculates the gallons of water required for completely filling the pool as per user…
Q: Hospital Patients Write a program that computes and displays the charges for a patient’s hospital…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: .35 (Sides of a Triangle) Write an application that reads three nonzero values entered by the user…
A: #include <iostream>using namespace std; int main(){ double a, b, c;…
Q: create a pusedocode #include #include #include using namespace std; int main (){ float…
A: Declare variables ga,fir,sec,thir,fin, q1, q2, q3, L1, L2, L3, L4, LP,t,fe,le,p,q; Input…
Q:
A: C++ program to Book Airline Tickets. The Destination is Chicago, Miami, and Portland. Variable in…
Q: Create class Employee. • Use static variable annualTaxRate to store the annual tax rate for all…
A: These programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: Rectangle STRUCT len WORD 2 wid WORD 2 Rectangle ENDS DATA r Rectangle main PROC MOV AX, r.len MUL…
A: Answer
Q: #include using namespace std; int Compute (int vall, int val2) { int result = 0; %3D int i; for (i…
A: The answer to the given question: This is a c++ program, In this particular program, the main…
Q: 4.26 Sum of squares Get a number (n) from the user, and then compute the sum of the squares of the…
A:
Q: 1.16 LAB: Input: Mad Lib Mad Libs are activities that have a person provide various words, which are…
A: According to the question Coding, language is not mentioned to write a particular programming…
Q: #include struct employees { char name[20]; int ssn[9]; int yearBorn, salary;…
A: #include <stdio.h> struct employees { char name[20]; int ssn[9]; int yearBorn,…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: Health application: BMI) Revise Listing 3.4, ComputeAndInterpretBMI.java, to let the user enter…
A:
Q: Summary 2 HouseSign.py - This program calculates prices for cu house signs. In this lab, you…
A: Code: # assigning variables to given values numChar = 8 charge = 0.00 color = 'gold' woodType =…
Q: Here are the contents for a movie: Lab 27 Home Alone Jeff Nunn 1990 Here are the contents for a…
A: According to the question We have to write code for the following question: Sample code and output…
Q: // EmployeeBonus.cpp - This program calculates an employee's yearly bonus. #include #include…
A: Code: #include <iostream>#include <string>using namespace std;int main() {…
Q: 24. Word Game Write a program that plays a word game with the user. The program should ask the user…
A: sample output
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Since you are asking multiple questions, we are answering first question for you. If you want…
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT) The number of permutations of a set of n items taken r at a…
A: PROGRAM: //include the required header file #include<iostream> using namespace std;…
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT) The number of permutations of a set of n items taken r at a…
A: //C++ program code: // Required C++ code #include <bits/stdc++.h> using namespace std; long…
Q: Module/Week 2 ASSIGNMENT (INPUT/OUTPUT)The number of permutations of a set of n items taken r at a…
A: C++ Source Code//include the required header file#include<iostream>using namespace…
Q: 1. Design a java application that outputs a table with a list of at least 6bstudents together with…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: #include #include #define MIN 1 #define MAX 30 struct Circle { float xCoord; float yCoord; float…
A: Code: #include <stdio.h>#include <stdlib.h>#include <time.h>#define MIN 1#define…
Q: class Calculator: # Type your code here. if __name__ == "__main__": calc = Calculator();…
A: Solution: Given, class Calculator: # Type your code here. if __name__ == "__main__":…
Q: Assign pizzasInStore's first element's caloriesInSlice with the value in pizzasInStore's second…
A: Here, pizzasInStore's first element's caloriesInSlice is pizzasInStore.at(0).caloriesInSlice and…
Q: Create a class Student that contains three members
A: Programming plan First, define the constant MAX as 40 that represents array size. Create a class…
Q: The array of sales data is as follows: Owner sales = [201.45, 550.00, 117.65, 55.25, 5.95, 365.45]…
A: To do: The given
Q: tinclude #include using namespace std; const int QUARTERS 4; // Write the prototype of…
A: PROGRAM CODE: #include <iostream>#include <iomanip> using namespace std; const int…
Q: a) Print the even numbers between 3 and 43. b) Print every third letter starting with 'B'. c) Print…
A: #include <iostream>using namespace std; void a() { int i; cout << "a() ->" <<…
The solution for the above given program is given below:
Step by step
Solved in 2 steps with 1 images
- def calculate_growth_cycle(plant_name): if(plant_name == "strawberry"): print("### The life cycle of a strawberry ###\nA seed takes 110 days to reach maturity.") elif(plant_name == "cucumber"): print("### The life cycle of a cucumber ###\nA seed takes 76 days to reach maturity.") elif(plant_name == "potato"): print("### The life cycle of a potato ###\nA seed takes 120 days to reach maturity.") else: print('Your plant is available, please try "strawberry", "cucumber" or "potato"') Plants Growth Cycle Learning Objectives In this lab, you will practice: Defining a function to match the given specifications Calling the function in your program Using if statements (can combine them with dictionaries) Instructions For every plant, there is a growth cycle. The number of days that it takes starting from being a seed and ending in being a fruit is what is called the growth cycle. Write a function that takes a plant's name as an argument and…JSON Response example when code = BAHRAIN as follows: { "Country": "Bahrain", "Tenps"il ("day": "SUNDAY", "temp"i {"day": "HONDAY", "temp": 35), ("day": "TUESDAYr, "teng": 39), ("day": "WEDNESDAY", "tenp": 37),. ("day"i "THURSDAY", "tenp": 35), ("day"i "FRIDAV", "temp": 34), ("day": "SATURDAY", "teng": 37) 1. Implement find Templ ) function as follows: Sample Eample This function will be called whenever the user change the value of the pull-down menu. This function should contact Ve the Web Service API, sending the selected country code, to Co display the information (country, daily temperatures in the week and average weekly temperature) inside the div tag whose id -result as shown in the example on the right. Country ahraln In addition, the country name and the average temperatures should be saved as one JS object inside an array in a local storage. Whenever new request is made, the countrylaverage will be saved and added to the array inside the local storage (duplicates is allowed).…int main{void main} { int myArray[100],numint,result; printf("How many numbers to be entered?"); scanf("%d"&numint); getNumbers(myArray,numint); printNumbers(myArray,numint); result=sumNumbers{myArray,numint}; printf("Sum of numbers entered=%d",result); return 0; } Based on this program, write down the function prototype for function getNumber().
- int main{void main} { int myArray[100],numint,result; printf("How many numbers to be entered?"); scanf("%d"&numint); getNumbers(myArray,numint); printNumbers(myArray,numint); result=sumNumbers{myArray,numint}; printf("Sum of numbers entered=%d",result); return 0; } Based on this program, write down the function prototype for below. Write the function getNumber(), printNumbers() and sumNumbers().def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount) #This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease #This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount #This function…Code Example: def get_volume (width, height, length=2): volume width * * height length return volume def main (): 1 3 W = 4 h = 5 V = print (v) = get_volume (1, w, h) if name main () "1 main : 1.) Refer to the Code Example: What value is passed to the height argument by the call to the get_volume() function?
- MP: Create a program using structures to compute for the final grade of a student with the following conditions; Prelim grade 30% Midterm grade 30% Finals grade 40% See screenshot below for your reference: Name: Juan Dela Cruz Prelim Grade: 89 Midterm Grade: 82 Finals Grade: 77 Student Name Final Grade : Juan Dela Cruz 82.10 Name: Bill Gates Prelim Grade: 77 Midterm Grade: 84 Finals Grade: 90 Student Name Final Grade : Bill Gates 84.30def division_calculator(a, b): ''' Question 4 You are asked to write a small division calculator, where you are taking 'a' as dividend and 'b' as the divider. You will need to return both the quotient and the remainder. Your returned result should be the: "a is divided by b, with the quotient equals 'quotient' and remainder equals 'remainder'" Note: You must use f-string to do this question. Args: a (int), b (int) Returns: string >>> division_calculator(3, 1) "3 is divided by 1, with the quotient equals 3 and remainder equals 0." ''' # print(division_calculator(9, 3))struct Player { string firstName; string lastName; int hits; int runs; }; int main() { Player p = { "Jackie", "Robinson", 1518, 947 }; Player team[24]; Player *tPtr = team; team[0] = p; // INSERT CODE HERE } The statement tPtr = team+9; will assign the same memory address to tPtr as the statement tPtr = &(team[9]);
- int main(){ long long int total; long long int init; scanf("%lld %lld", &total, &init); getchar(); long long int max = init; long long int min = init; int i; for (i = 0; i < total; i++) { char op1 = '0'; char op2 = '0'; long long int num1 = 0; long long int num2 = 0; scanf("%c %lld %c %lld", &op1, &num1, &op2, &num2); getchar(); long long int maxr = max; long long int minr = min; if (op1 == '+') { long long int sum = max + num1; maxr = sum; minr = sum; long long int res = min + num1; if (res > maxr) { max = res; } if (res < minr) { minr = res; } } else { long long int sum = max * num1; maxr = sum; minr = sum; long long int res = min * num1;…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…