If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a C++ program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears by using functions.
Q: With the help of c++, write a code that permits a user to input the surnames of 5 overall best…
A: In step 2, you will the C++ code. In step 3, you can see the sample output. In step 4, you will get…
Q: Write a C++ program to convert temperature in degrees Fahrenheit to degrees Celsius. Your program…
A: ALGORITHM:- 1. Take inout for the Fahrenheit temperature from the user. 2. Convert it to Celsius…
Q: Please help me to write a C++ code for the question statement below. In a grocery shop if the amount…
A: /* Program that input bill amount from user and print the discount and payable amountafter the…
Q: Develop a program for current electrical billing system based on the given requirements using the…
A: 1. Flowchart for generating electricity bill
Q: Q1/ Use the structure Time to write a C++ program that inputs a time in hours, minutes and seconds…
A: #include<iostream> using namespace std; //Time Structure struct Time { int h,m,s; };…
Q: create a flowchart and a c++ program that will compute the real state tzx, given the following…
A: EXPLANATION: - The variables of type double are declared and initialized as: - double…
Q: A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a…
A: The main objective of the c++ program is to prompt the user to enter the amount of milk in liters as…
Q: 1. In order to discourage excess electric consumption, an electrical company charges its customers a…
A: flowchart for problem 1 calculate electric bill
Q: You have to make aC Program to Convert Celsius from Fahrenheit, Kelvin and Réaumur or to Convert…
A: As per the question statement, we will write program in c language.
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: Given that You are required to produce a C++ program which solves the following:1- A worker is paid…
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: Procedure Followed: Include header files. Start main method. Declare variables:…
Q: We calculate weight normally in the unit of tola. Write a C++ program to enter the amount of gold in…
A: #include<iostream> using namespace std; int main(){ float tola,grams,amount,zakat;…
Q: Q2/ If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: CODE:- #include <iostream>using namespace std;void check(int numYears){ if (numYears >…
Q: Question 2: Ali gives pocket money to his son in following fashion. Whatever pocket money is given…
A: Include the required libraries in the program. Declare the main function. Declare the variables of…
Q: 04. Write a C program to check whether any year entered by the user is a leap year or not. Leap Year…
A: 1) Below is C program to check whether entered year is Leap year or not In main function of program…
Q: Homework: Draw the Flowchart for each program of the following: 1. Write a C++ program to calculate…
A: PROGRAMMING CODE FOR QUESTION 1: #include<iostream>using namespace std;int main(){double…
Q: Hello everyone. I have homework and I do but code is complicated for me. Homework. This program…
A: According to the question below the solution: Output:
Q: Q14/ If money is left in a particular bank for more than 5 years, the bank pays interest at a rate…
A: GIVEN:
Q: A travel company has three types of buses (A, B and C), each one has a price based on the kilometer…
A: - We need to code for the bus fare problem. - We have to use C language.
Q: B-A- Write a program in C++ to determines the patient if he is infected with corona virus or not…
A: #include<iostream> using namespace std; int main() { string name; int temp;…
Q: write a program which accept days and integer variable and display total number of years, month and…
A: Actually, program is a executable software that runs on a computer.
Q: We calculate weight normally in unit of tola. Write a C++ program to enter amount of gold in tola,…
A: A required C++ program is as follows, //Include header files #include <iostream>…
Q: Using functions, write a full C++ program that reads four integer numbers entered by the user two at…
A: Program to solve the Sum of the product problem: - Program: - #include <iostream>using…
Q: The domestic tariff charged by Sabah Electricity Sdn Bhd (SESB) is given in Table 1. Based on the…
A: #include <iostream> using namespace std; int main() { // Taking input of monthly usage from…
Q: Given the projectile's velocity (u), the projectile's angle (0), and the acceleration due to gravity…
A: - We need to solve the projectile problem in C.
Q: You are asked to write a C program that will accept representing the number of dollars and cents to…
A: Program when only cents are given: #include<stdio.h>void convert(int change){int i;// required…
Q: Write a C program to read electricity unit (kW) and calculate the total electricity bill (RM)…
A: As per the question statement, We need to write c program.
Q: A golf ball is dropped from an airplane. The distance, d, the ball falls in t seconds is given by…
A: totDistance = 0.5*Gravity*time*time; distance = totDistance - distance;
Q: user-defined function and appropriate conditional and looping statements, create a program using C++…
A: Explanation: Detail Code #include <bits/stdc++.h>using namespace std; int main(){ int…
Q: A management firm has 100 employees in total. The management firm increases the salary of the…
A: I have provided C++ CODE along with SCREENSHOT OF CODE WITH OUTPUT---------
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: Program: #include <stdio.h> int main() { int…
Q: Q7 Draw the flowchart and write a C program using else if to calculate the total amount to be paid…
A: The program prompts the user to enter basic loan amount and number of years. Basic loan amount is…
Q: The price of a stock is sometimes, taken to the nearest fourth of a rupee, for example, the value 29…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Please help me to write a C++ Code for the question statement below. In a grocery shop if the…
A: read amount if amount>1000 discount=(amount*10)/100 else discount=(amount*5)/100 display…
Q: Write a C++ program that asks for the user’s name and then the program will output the last 4…
A: C++ Programming-
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: A flowchart is a pictorial representation of an algorithm. It is a graphical representation of steps…
Q: If the total selling price of 15 items and the total profit earned on them is input through the…
A:
Q: Q1) Write a C++ Program that input the distance in Centimeter, Meter, Kilometer, and then converts…
A: CODE IN C++ CONVERT CENTIMETER , METER, KILOMETER. #include <bits/stdc++.h> using namespace…
Q: You are required to produce a C++ program which solves the following: 1-A worker is paid according…
A: Code #include <iostream>using namespace std;int main(){ string name; //for input user…
Q: LESCO want to make an automated system for their electricity bill calculation. They charge consumers…
A: Step 1:- Program Approach:- 1.Include header files 2.Create 7 variables of data type float 3.Take…
Q: This program reads a number of up to 9 digits. It then prints the number in English. In other…
A: Coded using C++.
Q: Write a C++ program to prompt the user to input the age (in years) and weight (in kg) and check if…
A: Ans: Code: #include <iostream> using namespace std; int main(){ int age, weight;…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: PROGRAM CODE: #include <iostream> // include header file for input output streamusing…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: The code and the output has been given in step 2.
Q: You are required to produce a C++ program which solves the following: 1- A worker is paid according…
A: PROGRAM CODE: #include <iostream> using namespace std; float calculateTD(float income) {…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: Step 1:- Program Approach:- 1.Include header file 2.Create the function whose name is year(int num)…
Q: Given a number in the range of 100 and 999, write a program to accept input and validate this range.…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: triangle, the sum of the lengths
A: /****************************************************************************** Write a c++ program…
Q: Draw flowchart and write C program to input the value of Basic salary and calculate the new salary…
A: Explanation for Flow chart: First start FC by start symbol oval in shape. Now draw user input…
Q: Question The volume of oil stored in an underground 200-foot deep cylindrical tank is determined by…
A: #include <iostream>#include<cmath>using namespace std; int main() { float…
Step by step
Solved in 3 steps with 2 images
- Write a function that determines if a number is prime. Use this function in a program that determines and prints all the prime numbers between 1 and 10,000. Do the required commented changes in the following program codeIt is estimated that a restaurant's tip box accumulates twice as much as the previous day. Write the function with the main () function that takes the number of days as a parameter and returns the total tip amount on the day entered in the restaurant with a 10-TL tip on the first day. Sample Work: Enter the number of days: 4 --------------------------------- Total estimated stake in the box: 150.00 -TL in cQ4: the volume of a cylinder is given by the formula: V=n r2L Where r is the cylinder's radius and L is its length. Using the above formula; write a program that uses a function which accepts a cylinder's radius and length as parameters and returns its volume.
- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears by using functions.// // Write a function that calculates the amount of money a person would earn over // a period of years if his or her salary is one penny the first day, two pennies // the second day, and continues to double each day. The program should ask the // user for the number of years and call the function which will return the total // money earned in dollars and cents, not pennies. Assume there are 365 days // in a year. // function totalEarned (years) { // Insert your code between here and the next comment block. Do not alter // // any code in any other part of this file. // Insert your code between here and the previous comment block. // any code in any other part of this file. Do not alter // // var years = parseInt(prompt('How many years will you work for pennies a day? ')); var totalDollarsEarned = totalEarned (years); alert('Over a total of ' + years + ', you will have earned $' + totalDollarsEarned);Complete the following program. An object floats in any fluid, if the density of the object is lower than the density of the fluid. Write a program to determine whether an object will float in the oil where the density of oil is 0.92 g/cm³. The program will read mass and volume of an object then computes its density and determines whether the object will float. Program consists of two functions as follows: void input(. .): This function with two pass by reference parameters, reads mass and volume of an object from the user. string process(. ..): This function receives mass and volume, computes the desnity of the object using formula as shown below: density=mass / volume If the density of the object is higher than the density of oil, it will return the string "Float", if the density of the object and the oil is equal then it returns a string "Stay at some place" otherwise it will return "Submerge". main () program is given below and you are asked to write the function definitions in the…
- Q1/ Write a program that takes hours and minutes as input and outputs the total number of minutes (1 hour 30 minutes = 90 minutes) By using functions. Q2/ If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears by using functions. Q3/ Write a program to compute and display a person's weekly salary as determined by the following conditions: If the hours worked are less than or equal to 40, the person receives $12.00 per hour; otherwise, the person receives $480.00 plus $18.00 for each hour worked over 40 hours. The program should request the hours worked as input and display the salary as output. HINT: using functions. Q4/ Write a program to find the value of X: X=2y+5z where y= r^2+7 HINT:…The following formula can be used to determine the distance an object falls due to gravity in a specific time period: d = 1⁄2 gt2The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the time in seconds that the object has been falling. Write a function named fallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value.LeakageDeduction.py Write a python programn that calculates the salary deduction of an employee who spills more petrol. The program should accept previous reading, current reading and quantity of petrol loaded inn number of petrol pumps. The petrol price per gallon is fixed to OMR 0.180. The vahue of n must be accepted as input. The program must define and use a function to calculate the Leakage quantity and deduction amount. The Leakage quantity is calculated using the following formula: Leakage = Quantity loaded - (Current Reading - Previous Reading) The deduction amount is calculated by multiplying leakage with the rate of petrol per gallon. The company has declared not to deduct full amount from employee's salary due to pandemic. Following table must be used to find the actual salary deduction: Deduction Amount (DA) Salary Deduction 10% of DA DA<10 102DA<20 202DA<40 20% of DA 30% of DA 40% of DA 50% of DA 402DA<50 DA250 Sample Inputs and Output PR Quantity Leakage Loaded CR…
- In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object's kinetic energy: KE = ½ m v2 The variables in the formula are as follows: KE is the kinetic energy, m is the object's mass in kilograms, and v is the object's velocity, in meters per second. Write a function named kineticEnergy that accepts an object's mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Demonstrate the function by calling it in a program that asks the user to enter values for mass and velocity.A variable x is assigned a NULL value. The return value from the function is.null(x) will be a. TRUE b. "Number" c. NULL d. "Character"You must have 2 functions: one computes the average and the other finds the letter grade. The average function should return back a Real value and the letter grade function should return back a string. All input and output must occur in main(). Only find and display the letter grade for the average, not each test score. Just a basic algorithm in pseudo code