Write a program to calculate electricity bill charged to a consumer. Ask him to enter the units consumed. For all units less than or equal to 200, each unit is to be charged at Rs. 2. If units>200 and <=400, first 200 units is to be charged at Rs. 2 and other units is charged at Rs. 4. Each unit more than 400 will be charged at Rs. 5.
Q: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
A: Your completed program should: 1. Prompt the user and read in the number of a team playing the…
Q: TASK 3: Write a program that accepts the input code from the user and print according to the input…
A: in c: #include <stdio.h>int main(){ int n1; printf("enter the number: ");…
Q: 4)Write program that input the user age and print the sentence: a) You are child if the age is less…
A: There is not mentioned any programming language so I used JAVA Step 1 : Declare a variable age and…
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as follows: If mark >=…
A: Get input from user and convert it to integer. Chek the input with all conditions and print output…
Q: Write a program to increase the salary depending on the number of hours of work per day as follows:…
A: Given: Write a program to increase the salary depending on the number of hours of work per day as…
Q: write a program to calculate electricity bill charged to a consumer.Ask him to enter the unit…
A: Program: #include <stdio.h> /* Main Function */ int main() { /* Declare the variables */…
Q: Write a program that displays every integer between 1 and 100 that is divisible by 5 or 7, but not…
A: Algorithm: 1.Include required header files 2.include main function 3.create a for loop 4.use if…
Q: 3. For three resistors connected in series, the total resistance is the sum of the individual…
A: Given: Resistors are connected parallel Therefore Total resistance is Total Resistance =…
Q: 1. Write a program that prompts the user to enter an integer between 0 and 6 and prints thie day…
A: I give both codes in C along with output and code screenshots.
Q: 1. Write a program that does the following: Ask the user to enter the price of their items. The user…
A: Actually, program is a executable software that runs on a computer.
Q: Write a payroll program that computes an employee's gross pay and net pay. An employee who works…
A: CODE IS: #include<stdio.h> { hours=int(input("Enter number of hours per week:"))…
Q: 1. Write a program that prints "You have passed" if a student gets a score of 50 and above, and…
A: QUESTION 1 PART 1 import java.util.*;public class HelloWorld{public static void main(String…
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as follows: If mark >=75…
A: VB program is asked with the following conditions: If mark>=75 print Grade = A If…
Q: Write true if the two statements are equivalent; otherwise write false. 1. ∼(∼p∨q) and p∨∼q 2. p…
A: Given that 1. ∼(∼p∨q) and p∨∼q 2. p and ∼(∼p) Those two are the statements check whether these are…
Q: Q2: Write a program to compute and display a person's weekly salary as determined by the following…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read no.of hours n…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: C++ Code for the given Question #include<bits/stdc++.h>#include <iostream> using…
Q: What is the output of the statements below? x=3 while x
A: Given : x=3 while x
Q: program so that the user enters the rate of tuition increase for the first year. the rate then…
A: C++ used to answer this question
Q: Q1/A-Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit…
A: Code: Dim A as DoubleDim M as DoubleDim Po as Double Dim K as DoubleDim R as DoubleDim T0 as…
Q: Suppose that x, y, z, and w are int variables and x = 25, y = 3, z = 12, and w = 4. What is the…
A: a. Program: //include the header file #include <iostream> using namespace std; //definition…
Q: Write a program that specifies whether a given number (x) falls in one of the following categories…
A: Description: Note: Since you have not provided the language to write the code so I am using java…
Q: The following equations estimate the calories burned when exercising (source): Women: Calories = (…
A: Though the question did not specify the programming language, the program has been developed using…
Q: 4. Write a program that computes the employee's payroll of ABC Company. The user is first asked to…
A:
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
Q: 2)write program that input three number and find the minimum number? 3)write program that input…
A: Main algorithm:- if(a<b && a<c) cout<<a<<" is minimum "; else…
Q: customer's credit limit is now RM250. UTM M4000. If a customer had a credit limit of RM500, this Due…
A: #include<iostream>using namespace std;int main(){ float c_score, limit, balance; int ac;…
Q: Let x, y, and z be True statements, and a, b, and c be False statements. If (b V ~ y) → (n → a) =…
A: In given question 1, we are given some true and false statements and asked for the value of n. In…
Q: 2. Write a program that determines a student's grade. The program will read three scores and…
A: Below is the required C++ program: - Approach: - Import the header file and include the namespace.…
Q: Write a program that repeatedly prompts a student to enter grade points (on a scale of 0-4) and…
A: Please find the answer below :
Q: 5. Write a program that determines the change to be dispensed from a vending machine. An item in the…
A: The program accepts the input value to a variable. It declared other variables for storing the…
Q: Make a flowchart where a program dispenses cash at an ATM machine that has been upgraded to dispense…
A: Since you needed the output screenshot I am attaching for both conditions thatis when amount is…
Q: Drive the whether following statements are true or false: P(x,y): 2x+2y=4 where x= {0,1,-1}, y=…
A: Statements true and false
Q: The following equations estimate the calories burned when exercising (source): Women: Calories = (…
A: Program: #definition of main function if __name__ == '__main__': #get the inputs data =…
Q: C++ Programming Exercise: Ther are 50 apartment units. When the rent is $600 per month, all the…
A: #include <iostream>using namespace std;#include<fstream>int main (){double rent,…
Q: Write a C++ program which calculates percentage of three subjects and then prints, the student is…
A: #include <iostream> using namespace std; int main(){ float m1,m2,m3; float…
Q: An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The…
A: Program code: // include required header files #include <iostream> #include <iomanip>…
Q: A contractor orders, say, 30 cubic yards of premixed concrete toconstruct a patio that is to be,…
A: Code : #include <iostream> #include <cmath> using namespace std; int main() {…
Q: 1. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40…
A: #ask user for hourly wage hourly_wage = float(input('\nEnter hourly wage: ')) #ask user for Number…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: Find the required code given as below and sample output :
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be…
A: Please find the answer below :
Q: Write a program that prompts the user to enter the annual income (in int) of an employee. The…
A: ** THIS CODE IS WRITTEN IN 'PYTHON' SINCE NOT PROGRAMMING LANGUAGE WAS MENTIONED. #get user input…
Q: 1- Write a program in which the user is asked to enter his age based on the year (assuming the…
A: Take input from user. check if the number is positive integer or no. and if the number is positive…
Q: The following equations estimate the calories burned when exercising (source): Women: Calories (…
A: Required:
Q: 2. Write a program that computes the cost of painting and installing carpet in a room. Assume that…
A: Actually, program is a executable software that runs on a computer.
Q: (a) Prompt the user to enter two positive integers n and m (you are not required to handle the case…
A: #include<iostream>#include<math.h>#include<stdlib.h>#include<conio.h>using…
Q: A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be,…
A: Given The answer is given below.
: Write a
Step by step
Solved in 3 steps with 4 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.)Suppose you want to deposit a certain amount of money into a savings account with a fixed annual interest rate. We are interested in calculating the amount needed to deposit in order to have, for instance, $5000 in the account after three years. The initial deposit amount can be obtained using the following formula:Question 1 Write a payroll program that computes an employee's gross pay and net pay. An employee who works more than 40 hours per week should be paid at overtime rate (1.5 x regular rate) for all hours over 40. Compute net pay by deducting 10% of gross pay only if an employee earns more than RM1500.
- Interest on a credit card’s unpaid balance is calculated using the averagedaily 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) / d1If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is:interest = averageDailyBalance * 0.0152Write a program that accepts as input netBalance, payment, d1, d2, and interest rate per month. The program outputs the interest. Format your output to two decimal places.A parking garage charges a $20.00 minimum fee to park for up to three hours. The garage charges an additional $5.00 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24- hour period is $50.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and printsthe parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format: Car Hours Charge1 1.5 20.002 4.0…Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönder
- f. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and prints the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format Sample output Enter the hours parked for 3 cars: 1.5 4.0 24.0 Car Hours Charge 1 1.5 2.00 2 4.0 2.50 3 24.0 10.00 TOTAL 29.5 14.502. Party shop sells birthday gift bags in two ways. set of 12 bags for $17.99 or an individual bag for $1.75. Customers can purchase a Write a complete program that asks the user input for the number of gift bags need to be purchased (an integer) and outputs the total price of the purchase. a) For example, if the customer buys 14 gift bags, the customer would be charged for 1 set of (12 bags) plus another 2 individual bags. The subtotal would be 1 (17.99) + 2 (1.75) = $21.49. b) Use a constant variable to set a fixed tax rate of 8.875. c) Display correct dollar values (2 decimal places, use cout precision). User input can be any content and it's bold and italicized for clarity. Example Output 1 Welcome to Party Shop! How many gift bags would you like to purchase: 14 SHOPPING CART 1-set (s) $17.99 2-individual $3.50 Subtotal: $21.49 Таx: $1.91 Total: $23.40 Thank you shopping Party Shop! Example Output 2 Welcome to Party Shop! How many gift bags would you like to purchase: 11 SHOPPING…
- When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it by making periodic payments. Suppose that the loan amount is L, r is the interest rate per year, m is the number of payments in a year, and the loan is for t years. Suppose that i = (r / m) and r is in decimal. Then the periodic payment is: You can also calculate the unpaid loan balance after making certain payments. For example, the unpaid balance after making k payments is: where R is the periodic payment. (Note that if the payments are monthly, then m = 12.) Instructions Write a program that prompts the user to input the values of L, r, m, t, and k. The program then outputs the appropriate values. Your program must contain at least two functions, with appropriate parameters, to calculate the periodic payments and the unpaid balance after certain payments. Make the program menu driven and use a loop so that the user can repeat the program for different values. Example of…The monthly payment for a givenloan pays the principal and the interest. The monthly interest is computed by multiplyingthe monthly interest rate and the balance (the remaining principal). The principalpaid for the month is therefore the monthly payment minus the monthly interest.Write a program that lets the user enter the loan amount, number of years, and interestrate then displays the amortization schedule for the loan. Here is a sample run: Loan Amount: 10000 ↵EnterNumber of Years: 1 ↵EnterAnnual Interest Rate: 7 ↵EnterMonthly Payment: 865.26Total Payment: 10383.21Payment# Interest Principal Balance1 58.33 806.93 9193.072 53.62 811.64 8381.43...11 10.00 855.26 860.2712 5.01 860.25 0.01In python, a) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for the number of points to risk and a second prompt asks the player to choose either High or Low. The player’s choice of either High or Low is compared to a random number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, then it is considered “low”. A number between 8 and 13 inclusive is “high”. The number 7 is neither high nor low, and the player loses the points at risk. If the player had guessed correctly, the points at risk are doubled and added to the total points. For a wrong choice, the player loses the points at risk. Create a HiLo application based on this specification. Application output should look similar to b) Modify the application to allow the player to continue until there are 0 points left. At the end of the game, display the number of guesses the user took before running out of points.