( 2.5, if 0 < w <= 2 4.5, if 2 < w <= 4 c(w) 7.5, if 4 < w <= 10 10.5, if 10 < w <= 20
Q: 12- With the following declaration: int [.] points = {{300, 100, 200, 400, 600}, {550, 700, 900,…
A: Here we are declaring a 2D array with 2 rows and 5 columns. As we know that array can be accessed…
Q: Pakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to 5). Once…
A: Write the program as follows: Create a 2D array of size 4*5. Input the sales of product for each…
Q: This program will allow a user to enter any dollar and cents amount and then will provide change.…
A: ALGORITHM:- 1. Take input for the initial amount. 2. Convert in into change until the remaining…
Q: SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of…
A: Code: SalaryStmt.py numbers=int(input("Please enter no of Employee…
Q: lo this you will no longer need an if statement. cout > number; f (number $ 2 != 0) out ng…
A: The Answers are given below:
Q: A software company sells a package that retails for $499. Quantity discounts are given according to…
A: //include the required header files #include<iostream> #include<iomanip> using namespace…
Q: Program2: function Write a program that prompt the user to enter two positive integer numbers x and…
A: C++ Program for above : #include <iostream> using namespace std; int main() { //get…
Q: Write a program whose inputs are three integers, and whose outputs are the largest of the three…
A: A Corel is a simple high level programming language. It is also used for making flowchart. We type…
Q: Q.1 - manufacturer wishes to determine the cost of producing an open-top cylindrical container. The…
A: #include <stdio.h> int main() { //declaring variables float…
Q: A carpet company has determined that every 50 square feet of floor coverage will require 6 hours of…
A: I give the code in Java along with output and code screenshot
Q: large cup program should alow the user to do the following S2.00. Write a menu-oriven program that…
A: C++ used to answer this question
Q: Q.1 Use function to write a C++ code that asks the user to choice one of four options.(you will need…
A: We will solve the given problem in C++ language.
Q: Assume that you have price distributions as follows: (000 - 299 $), (300 – 599 $), (600 – 899 $),…
A: Program approach:- Using the necessary header file. Define the main function. Displaying STAR for…
Q: Please note global variables are not allowed to use in this assignment except of global constants.…
A: Code: #include <iostream> using namespace std; // get sales from user int getSales(string…
Q: Question 1) Write the following function by using if statement: et - 1, x 10 y=
A: I give the code in Matlab along with output and code screenshot
Q: Q.1 Use function to write a C++ code that asks the user to choice one of four options.(you will need…
A: We will solve the given problem in C++ language.
Q: Write a program to take input for a number, if the number is palindrome, then display its half on…
A: Approach: Three functions are used: isPalindrome() function accepts an integer and returns 1 if the…
Q: SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of…
A: CODE TO COPY:- numbers=int(input("Please enter no of Employee "))names=[]average=[]bonus=[]def…
Q: If ax + bx + c = 0, a + 0, then x = b + Vb? - 4ac 2a Write a program to solve the quadratic…
A: According to the Question below the Solution: Program Output:
Q: Create a flowchart that will accept three unique integers and print the sum, product and the average…
A: STEP 1 Start STEP 2 Read A, B, C STEP 3 COMPUTE Sum = A+ B + C STEP 4 COMPUTE Prod =…
Q: 2. F&B Fast-Food Restaurant offers three types of menu. Each customer can make an order based on the…
A: Given below java program which implements the methods to implement above asked program, make sure…
Q: The distance between two points pA (XA,YA) and pB (XR YB) is calculated as follows Distance = (XA–…
A: Algorithm Start Step 1-> Firstly declare function i.e. void discalculus use to calculate distance…
Q: SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Q1 // Follow the following program, explaining the results: (If you know that L is your grade in the…
A: - We have to track the values of L and K from the program given.
Q: 20.4 LAB: Max and min numbers Write a program whose inputs are three integers, and whose outputs…
A: start declare two function def smallest_number(num1, num2, num3): if(num1 <= num2 and num1…
Q: Senior salesperson and junior salesperson are paid per a week. Write a program that accepts as input…
A: The iostream is the header needed as the fundamental I/o streaming item. h ,a file of similar type…
Q: Plenitude Property Developer offers freehold land in Penang to buyers only originated from Penang.…
A: #include<stdio.h> //calculatesRectangle function void calculatesRectangle(float length,float…
Q: Four track athletes entered the mile race at the Manila Relays. Write a program that will read in…
A: In the given question we need to calculate speed from given time. If we know how far an item goes…
Q: 2. Write a Python program prompts the user to input number of hours worked, hourly rate and output…
A: Program Approach: Defining the method Calculating double overtime Calculating overtime Calculating…
Q: Write a C++ program that calculate and display the total fee for B.Sc. program in Engineering…
A: Code: #include <iostream>using namespace std; int calculateCourseFee(int ch,int fpc,int…
Q: Geumga Bowling Centre giving a special rate for their customer as shown in Table 1: Table 1: Table…
A: Sample output
Q: A company has 45 employers, 25 work as system developers (D) and (N) work as sales representer while…
A: Below is the flowchart:
Q: Write a program that will read in the number of liters of gasoline consumed by the user’s car and…
A: Sample Response: //C++ program to find the number of miles per gallon#include <iostream>using…
Q: Write a C++ program that calculate and display the total fee for B.Sc. program in Engineering…
A: Answer in step2
Q: SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Assume that you have price distributions as follows: (000 - 299 $), (300 – 599 $), (600 – 899 $),…
A: ALGORITHM:- 1. Take input for each occurences. 2. Check if the input is greater than 50. 3. Print…
Q: 1. Write a code using the if/else condition where user enters an integer value for percentage. You…
A: Given, If Percentage >80, grade A If Percentage >70 but Percentage <=80,…
Q: The distance between two points pA (XA,YA) and pB (XB,YB) is calculated as follows Distance =…
A: The program is written in C. Please find the solution and output in the following steps.
Q: The program must accept the Employee Number, Salary and Employee job grade, calculate each…
A: import java.util.Scanner; public class TaxReport{ public static void main(String args[]){ Scanner…
Q: Suppose that you work for a beverage company. The company wants to know the optimal cost for a…
A: ALGORITHM:- 1. Take input for the radius and volume from the user. 2. Define a function to compute…
Q: The East Coast sales division of a company generates 62 percent of total sales. Based on that…
A: CODE:- #include <iostream>using namespace std; int main(){ double PoTS = .62,…
Q: Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It…
A: PROGRAM CODE: #include <iostream>#include <iomanip>using namespace std; // function…
Q: Digi offer three different subscription packages for its customers: Package A: For RM10 per month,…
A: - The question is to code the provided billing statement in C++.
Q: 3. Write a program that as the user to enter their 4 test scores. Based on their average test scores…
A: ANSWER:-
Q: ram whose inputs are three integers, and whose outputs are the largest of the three values and the…
A: Code: number1 = int(input(' '))number2 = int(input(' '))number3 = int(input(' '))def largest(num1,…
Q: In C++ A carpet company has determined that every 50 square feet of floor coverage will require 6…
A: #include<iostream>using namespace std; bool inputValidate(double);void getInfo(double&,…
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:
shipping company uses the following function to calculate the
cost (in dollars) of shipping based on the weight of the package (in pounds).
Write a
display the shipping cost. If the weight is greater than 20, display a message “the package cannot be shipped.”
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)int a = -2, b = 5, c = 1, d = 11, e = -5; int x = e + d - 2; a = b - c + x; b = e * x + 5; c = d / 3 - x; d = b + c - 7; e = a + c - x; a = b = c = d = e =Interest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 – payment * d2) / d1 If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest = averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month (interestRate). The program outputs the interest. Format your output to two decimal places. Input: 100 30 50 7 9.7 Output: 856.83 Test case 2: Input: 255.76 31 55 3 12.3 output: 3080.38
- Interest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 – payment * d2) / d1 If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest = averageDailyBalance * 0.0152 Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month (interestRate). The program outputs the interest. Format your output to two decimal places.Interest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalanceis the balance shown in the bill, paymentis the payment made, d1is the number of days in the billing cycle, and d2is the number of days payment is made before the billing cycle. Then the average daily balance is: averageDailyBalance = (netBalance * d1 –payment * d2) / d1 if the interest rate per month is say, 0.0152, then the interest on the unpaid balanceis: interest = averageDailyBalance * 0.0152 Design a program that accepts as input netBalance, payment, d1, d2, and interest rate per month. The program outputs the interest charged. Format your output to two decimal places. C++Language C++ It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward teaching. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2000. a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented…
- Where is the second part of this assignmentWhat does the function f do? struct Point2D { double x; double y; struct Triangle { Point2D v1; Point2D v2; Point2D v3; }; void f(Triangle&t) { } int temp = 12.5; temp = t.v1.x; t.v1.x = t.v1.y; t.v1.y = temp; } int main () { Triangle mytri; mytri.v1.x = 1.0; mytri.v1.y = 22.5; f (mytri); Swaps values of x and y in vertex 1 of an argument of type Triangle Initializes value of x in vertex 1 of an argument of type Triangle Sets all x,y values in all vertices of an argument of type Triangle Swaps value of x in vertex 1 with value of x in vertex 2, for an argument of typeQuestion Using Java programming language write a program to manage a hotel with 24 rooms;10 rooms are Executive, with price Gh ₵ 2500.00 per night,7 rooms are Chalets, with amounts Gh ₵ 1500.00 per night7 rooms are Ordinary, with amount Gh ₵ 500.00 per night The program should allow customers to book for rooms for a number of nights, and update the number of empty rooms available for each category when a customer has paid fully and has checked-in; also update the number of empty rooms available when customer checks-out.Customers should make bookings with their first names, telephone number A customer should be prompted to know if a room is booked (meaning a another customer has booked it but has not paid fully, or has not checked-in) A customer should be prompted to know if a room is occupied (meaning a booked room has been fully paid for, or the customer has checked-in) A customer should be prompted to know if a room is available (meaning a room has neither been booked nor…
- Credit Rating (feature1) Liabiltiy or not (Target) Yes No Total Excellent 3 1 4 Good 4 2 6 Poor 0 4 4 Total 7 7 14 Balance (feature2) Liabiltiy or not (Target) Yes No Total >50K 2 6 8 < 50 K 5 1 6 Total 7 7 14 Liability Tables Refer to the ‘Liability’ tables above, the target variable is Liability which can take on two values “Yes” and “No” and we 2 features: Credit Rating (which can take on values “Excellent”, “Good” and “Poor”), and Balance (which can take on values “> 50K”, “< 50K”). There are 14 observations in total. See the above liability table for different figures of ‘excellent’, ‘good’, ‘poor’ credit ratings and ‘Yes’, ‘No’ liability class. Use decision tree algorithm to work out which feature provides more information or reduces more uncertainty about our target variable out of the two using the concepts of entropy and information Gain.Please answer ASAP,…can you please write it in java.util.scanner form Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: • If a customer purchases 0 books, he or she earns 0 points. • If a customer purchases 1 book, he or she earns 5 points. • If a customer purchases 2 books, he or she earns 15 points. • If a customer purchases 3 books, he or she earns 30 points. • If a customer purchases 4 or more books, he or she earns 60 points. Write a program that asks the user to enter the number of books that he or she has purchased this month and then displays the number of points awarded.e11: Find the value of A for the following: A = (5 + 2* 3+ (( 3-2)* 7)+ -9) /2.