write a program to calculate the net salary after increment for employee salary based on following table:
Q: What is the time complexity of the following function? def mystery(lst): index = 0 while index <…
A: if you will see in inner loop that is running power of index which is index of outer loop. means its…
Q: Q2: Write a program to calculate the average of student who has registered n number of courses.
A: The problem is based on the basics of object oriented programming in C++ programming language.
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: Ans:) In this required problem we need to create an algorithm to find the maximum profit in trading…
Q: PYTHON PROGRAMMING #Finish the favFoods function that takes as input a list of foods and returns a…
A: Task :- Write a python program to find the the occurences of "pizza" in given list. Python program…
Q: Write a program that tests as many of the math library functions in as you can.Exercise each of…
A: C code: #include<stdio.h> #include <math.h> int main(){ printf("ceil(3.6):\t…
Q: What is the output of the program below? (Note: This program works as expected)…
A: [1, 2, 3, 4, 5] 7 8 BEFORE FUNCTION[5, 2, 3, 4, 1] 1 3 INSIDE FUNCTION[5, 2, 3, 4, 1] 1 8 AFTER…
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: The algorithm for finding the maximum is as follows: maintain a record for minimum price seen and a…
Q: Exercise 3: Write a function fact (n) which returns the factorial of n (n!). Vote: n! is undefined…
A:
Q: This dataset “Birthweight_reduced_kg_R" contains information on new born babies and their parents.…
A:
Q: Given the code: void d(int n) { if(n<2) { cout << n << " "; return; } cout << n << " "; d(n/3); } 1.…
A:
Q: Add lists to the program below and a function where it is used. Identify them
A: Use separate list for heights and weights Call the function by passing weights and heights list
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: current profit = INT_MINcurrent buy = stock_prices[0]global sell = stock_prices[1]global profit =…
Q: Using the example given above, Write a program to print a table of values of n, logn, n², and 2 for…
A: ALGORITHM: Step 1: Import the math library to define the math function for log values Step 2: In…
Q: ample format StudentsHoursGrades.txt file Aaron Rodgers 12 (credits) 60 (hours studied)
A: Python code /Aaron rodger dictionary Aaron rodgers={"name": "Aaron rodgers", "aasignment"…
Q: Bill Discount Write a Python program that calculate the bill discount based on the customer type…
A: Python Program for above : #get the bill Bill = float(input("Enter your bill: ")) customer =…
Q: Please rewrite the code given below and written in C, in Python. #include #include int…
A:
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: current profit = INT_MINcurrent buy = stock_prices[0]global sell = stock_prices[1]global profit =…
Q: Write a function called sumSeries that computes the following summation: ?(?) =1/2 +2/3+....+i/(i+1)…
A: Program: #include <iostream> using namespace std; double sumSeries(int x) { double sum =…
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: current profit = INT_MINcurrent buy = stock_prices[0]global sell = stock_prices[1]global profit =…
Q: If their mark sheets are Fifty students in a class appeared in their final examination. The division…
A:
Q: C programming Write a program that asks the user to enter names and GPAs of 5 students. Then your…
A: #include<stdio.h>struct student{ char name[30]; float gpa;}; int main() { struct…
Q: Given the following declaration: int j; int sum = 0; double expenses [15] [8] ; Which of the…
A: GIVEN:
Q: This function is named compound interest, takes these arguments pr nt; compute and return a for…
A: nt will be at the exponent level of (1+r/n) and the exponent can be represented using ** operator…
Q: Write the in_order() function, which has a list of integers as a parameter, and returns True if the…
A: # returns true if list is sorteddef in_order(test_list): return all(test_list[i] <=…
Q: MP: Create a program using structures to compute for the final grade of a student with the following…
A: program using structures to compute for the final grade of a student with the following conditions:…
Q: Consider this very simple function: def cube(x): answer = x*X*X return answer b) Show how a program…
A: Given function is, def cube(x): answer=x*x*x return answer This function returns the cube…
Q: Take five numbers from the user and find the minimum and the average of only the even numbers…
A: n is a number of elements in the array and array[] are used to hold the elements. Now, check the…
Q: Write program to enter rainfall and associated city in two lists
A: Rainfall = []Cities = [] city = input("Enter city: ").upper() while city != "XXX": rain =…
Q: Consider this very simple function: def cube (x): answer = x * X*X return answer b) Show how a…
A: Given function is, def cube(x): answer=x*x*x return answer This function returns the cube…
Q: Consider the following two sum functions: def sum_iter(x: int) -> int: result: int = 0 while x >= 0:…
A: Please find the answer below:
Q: The advertising expenditure(X) and sales (Y) in thousands of dollars for a small retail business in…
A: Not-Assume that provided data are in CSV format. We are providing answers in the python language .…
Q: he Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the…
A: Given question has asked to design the logic that produces a merged list of patients' names in…
Q: Q3: By using Select-Case; write a program to calculate (BMI body mass index) (11 M) weight BMI =…
A:
Q: mplement a function void printAll(void) to print all the items of the list.
A: Here the pointer list is pointing to first node of listNode. The next node is accessed by using…
Q: generator function that generates each of the numbers requested in the previous question (that are…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: Identify invalid variables names from the following lists. Justify your answer. i) Student name…
A: The invalid keyword are as follows: double,student name,currency$,2number,3456. Below is the…
Q: Write a python program that return the total aquaculture production by Year, Region, and…
A: thee is no dataset given in the question
Q: Write Python program to store salary of 100 employees into list salary. The program should determine…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: For the end of year administration of Programming for History of Arts students you are to write a…
A: Given:
Q: Using C++ For each game played you will write the final results for the player and the computer.…
A: I gave the code in c++ as per your requirement along with output screenshot and code screenshot
Q: Write a program that asks the user to input the following data for n employees: - • Basic Salary •…
A: (1)First we read the number of employees (2)Loop for each employee (3) Read the salary (4)Read the…
Q: Write a Python program that asks the user for a quantity then takes that many numbers and prints the…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Using Python, create a program that allows a real estate agent to enter the cost of homes in a given…
A: Python program that allows a real estate agent to enter the cost of homes in a given area into a…
Q: PYTHON PLEASE EXPLAIN STEP BY STEPS AND THE OUTPUT School_sum calls the class_sum function: def…
A: Here function class_sum() will received a number num. And return num*3 i.e multiply num by 3 and…
Q: Given the following declaration: int j; int sum = 0; double expenses[15] [8]; Which of the following…
A: Answer: NONE OF THE OPTION WILL correctly finds the sum of the sixth column of expenses. the correct…
Q: A person is trading his money in the stock exchange market. Assume that the daily price of a…
A: Answer: Algorithm:- stock = []max_diff , buy ,sell =0;for i in range of stock[]: j=i+1; for j in…
Q: Write a program that prompts the user for a positive integer N>1, then calls a function called FACT…
A: Program code: //include the required packages #include <iostream> using namespace std;…
Step by step
Solved in 3 steps with 1 images
- Write a C# program that accept a student biodata; names, age, sex and address. You should also do the following: 1. Accept n number of courses and their scores for each student 2. Assign appropriate unit to each of the course entered. 3. Classify the scores according to the table below Letter Grade Point Mark % A 4 70 – 100 B 3 60 – 69 C 2 50 – 59 D 1 45 – 49 E 0 0 – 44 Grade Point per course (GP) = unit*point Total Weighted Grade Point (TWGP) = ∑GP Total Number of Unit (TNU)= ∑units Computation of Cumulative Grade Point Average (CGPA) In order to obtain the Cumulative Grade Point Average (CGPA) of a student = TWGP/TU The value of CGPA shall be expressed correct to two decimal place. Cumulative Grade Point Average Class of Degree 3.5 – 4.00 First 3.0 – 3.49 Second Class Upper 2.0 -2.99 Second Class Lower 1.0 – 1.99 Third Class <1.0 Fail Finally, generate the class. Note:…Java code Ever wondered how change is disbursed to customers in certain stores? In country X the following notes exists 200,100,50,20,10 and following coins: 5, 1, 50c, 10c, 5c. For the sake of this exercises let us only consider change below 50 see below example: Sample run 1: Enter item name: Apples Enter QTY of Apples: 2 Enter price per item N$: 3.25 Amount tendered N$: 50 Your change is: N$ 43.50 Disbursed as follows: 2 x N$20; 0 x N$10; 0 x N$5; 3 x N$1; 1 x 50c; 0 x 10c; 0 x 5c [Hint: make use of % and / operators to determine the values needed]By looking at this formula, F=9/5C+32, it can be used to convert Celsius temp to Farenheight. Write a program that shows a TABLE of all celsius temps 0-20 with the Farenheight equivalency next to it in table. Thanks. :) Not sure how to make a "table" in Java and this would help a lot. :) ,Sam
- I need the program to print the line "Meal options:" only when there is enough money. def get_possible_meals(budget, num_persons): tacos_cost = 4 empanandas_cost = 3 max_tacos = budget // tacos_cost max_empanadas = budget // empanandas_cost feasible = False print("\nMeal options:") for num_tacos in range (max_empanadas + 1): num_empanadas = (budget - num_tacos * tacos_cost) // empanandas_cost if num_empanadas > 0andnot (num_empanadas + num_tacos) % num_persons: feasible = True total_cost = num_tacos * tacos_cost + num_empanadas * empanandas_cost change = budget - total_cost print(f'${total_cost} buys {num_empanadas} empanadas and {num_tacos} tacos with ${change} change. {(num_empanadas + num_tacos) // num_persons} items per person.') ifnot feasible: print(f'You cannot buy a meal with these options.') def main(): budget = int(input('Enter budget for meal: $')) num_people = int(input('How many people are eating: ')) get_possible_meals(budget, num_people) if __name__ == '__main__':…PYTHON CHALLENGE ACTIVITY 6.7.2: Function with branch: Popcorn. 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)Write a program called StudentTable that prints the below table. Use only print() or printf(). DO NOT use println(). ////////////////////\\\\\\\\\\\\\\\\\\\\=============Student Points=============\\\\\\\\\\\\\\\\\\\\////////////////////Name Lab Bonus Total ---- --- ----- -----Joe C 7 50.5William B 8 58.2Mary Sue G 10 49.91) Use \\ to print a single \2) Use \n to go to next line3) Use left justify %– each for Name, Lab, Bonus, Total4) Use width size of 10 (%10) each for Name, Lab, Bonus, Total5) Use %s for String (Joe, William, Mary Sue), %c for char (C, B, G), %d for int (7, 8, 10), %f for double (50.5, 58.2, 49.9)
- Given a square matrix with the elements 0 or 1, write a program tofind a maximum square submatrix whose elements are all 1s. Your programshouldprompt the user to enter the number of rows in the matrix. The program then displaysthe location of the first element in the maximum square submatrix and thenumber of rows in the submatrix. Here is a sample run: Enter the number of rows in the matrix: 5 ↵EnterEnter the matrix row by row:1 0 1 0 1 ↵Enter1 1 1 0 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵EnterThe maximum square submatrix is at (2, 2) with size 3 Your program should implement and use the following method to find the maximumsquare submatrix:public static int[] findLargestBlock(int[][] m)The return value is an array that consists of three values. The first two values arethe row and column indices for the first element in the submatrix, and the thirdvalue is the number of the rows in the submatrix.Write a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives. Order Volume Discount Rate >= 200 bags 25% off 120 - 199 bags 20% off 60 - 119 bags 15% off 40 -59 bags 10% off 20 – 39 bags 5.5% off 0-19 bags No discount (1) Inyourprogram,definevariableswithmeaningfulnamestoacceptuserinputonordervolume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table. (2) Yourprogramshouldprintoutuserordervolume,discountrate,andtotalorderingcostinconsole (similar to the following sample outputs)Write a program that generates a two-column table showing Fahrenheit temperatures from -40F to 120F and their equivalent Celsius temperatures. Each line in the table should be 5 degrees F more than the previous one. Both the Fahrenheit and Celsius temperatures should be accurate to 1 decimal place. Note......BOOK: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th Author: Y. Daniel Liang Publisher: Pearson ISBN: 9780134670942
- Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }Question #1. Product in the Range [N...M]Write a Program that reads a starting number (N) and ending number (M) and prints all the numbers product betweenthe rangesFor instanceN= 2 M= 6 X=7202*3=6 6*4=24 24*5=120 120*6 =720 Solve with C#Write a program that accepts the names of three political parties and the number of votes each received in the last mayoral election. Display the percentage of the vote each party received. An example of the program is shown below: Enter name for first party >> Pool Party Enter votes received >> 87 Enter name for second party >> House Party Enter votes received >> 54 Enter name for third party >> Surprise Party Enter votes received >> 111 The Pool Party party got 34.523809523809526 percent of the vote The House Party party got 21.428571428571427 percent of the vote The Surprise Party party got 44.047619047619044 percent of the vote