3. Steven bought 375 shares of stock at a price of RM35.00 per share. He must pay her stockbroker a 2 percent commission for the transaction. Write a program that calculates and displays the following: a. The amount paid for the stock alone (without the commission) b. The amount of the commission c. The total amount paid (for the stock plus the commission) Note : You are required to use constant variable in the program for related variable.
Q: 2) Write a program to calculate the tip for a service. Prompt the user to enter the bill amount and…
A: Note: As no specific programming language is mentioned, the program has been provided in C. The same…
Q: C++ Celsius to Fahrenheit Write a program that converts user input in Celsius to Fahrenheit…
A: Here have to determine c++ code for Celsius to Fahrenheit.
Q: Pretend that you have just opened a new savings account that earns 4 percent interest per year. The…
A: Answer:)
Q: PLEASE USE THE SWITCH-CASE STATEMENT FOR THIS PROBLEM The Kingdom of Aleria uses gold coins and…
A: Given, 1 gold=15 silver 18 silver=30 nickel So, 1 gold=15 silver=(30/18)×15=1.667×15 nickel 10…
Q: 8. If P is the population of the first day of the year, B is the birth rate and D is the death rate,…
A: To develop the required program, we need to take the input from the users and then check the values…
Q: Exercise 2. Write a program that inputs three integer numbers from the keyboard and prints the sum,…
A: Step-1: Start Step-2: Declare and Input three float variables a,b,c Step-3: Calculate their sum…
Q: c++ Total Purchase A customer in a store is purchasing five items. The prices of the five items…
A: Overview of the Code: 1. Store the price of the item purchased. 2. Add all the item's price to get…
Q: - If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: Actually, program is an executable software that runs on a computer.
Q: 5. Prompt the user to enter the values of two double variables and print "True" in the output if the…
A: start Input two double values check if these two values in between 0 and 1 if yes print True else…
Q: 2. Write a program for the Air Force to label an aircraft as military or civilian. The program is to…
A: Here is the approach : Create the two integers to take input for the plane speed and the plane…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate 4.5%;…
A: PROGRAM CODE: #include <iostream> using namespace std; int main(){ int numYears,money;…
Q: (Science calculate energy) Write a python program that calculate the energy needed to heat water…
A: The given problem is to be solved using the python program that will take the water weight, initial…
Q: I am stuck on this problem- this is the question: Meadowdale Dairy Farm sells organic brown eggs to…
A: Note: Below is the required program in java language. Programming Approach: Importing necessary…
Q: Write a program that displays the following checkerboard pattern. Your program must use only three…
A: Hello student Greetings Hope you are doing great. I will try my best to answer your question. Thank…
Q: 6-In K Write the equivalent C++ statement for the following Math formu -2*(x*x' 'y)*(-9*(x*y)+12*(x'…
A: Input of program : for formula 1: b,c,K,L for formula 2: x,y In C++: The * sign is used for…
Q: Modify the provided code for the program that calculate the overtime hours to: a. calculate the…
A: Given requirement, Modify the provided code for the program that calculates the overtime hours to:a.…
Q: Read and analyze the problem below carefully. Create a program using the if and if-else statements.…
A: I give the code in Python along with output and code screenshot
Q: Summary During winter when it is very cold, typically, everyone would like to know the windchill…
A: Program code: //include required header files #include <iostream> #include <cmath>…
Q: Assuming there are no deposits other than the original investment, the balance in a saving account…
A: I give the code in C++ along with code and output screenshot
Q: A country charges income tax as follows based on one’s gross salary. No tax is charged on the first…
A: 1) Since you have not specified programming language, I have written program in python 1) Below is…
Q: The simple interest on a loan is calculated by the formula • Interest=principal * rate * days / 365…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: For each used car a salesperson sells, the commission is paid as follows: $20 plus 30% of the…
A: Program: //include the header file #include<iostream> using namespace std; //definition of…
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: Write the statements to print the even numbers from A to B when they are input by the user. (Assume…
A: Given: Write the statements to print the even numbers from A to B when they are input by the user.…
Q: During the past decade ocean levels have been rising faster than in the past, an average of…
A: Given:- During the past decade ocean levels have been rising faster than in the past, an average of…
Q: Body Mass Index (BM) is a measure of health on weight. It can be calculated by taking your weight in…
A: The above question is solved in step 2 :-
Q: A retail company must file a monthly sales tax report listing the sales for the month and the amount…
A: Question. A retail company must file a monthly sales tax report listing the sales for the month and…
Q: The following table shows the approximate speed of sound in air, water, and steel:Write a program…
A: Given: You can calculate the amount of time ittakes sound to travel in air with the following…
Q: Assume you have $2250. You plan to invest it at 6 percent interest per year. How many years will it…
A: Het there, I am writing the required solution for the above stated question.
Q: Could someone help me make The program in python, it should allow user enter invested amount,…
A: In step 2, you will get python code. In step 3, you can see the sample output.
Q: A country charges income tax as follows based on one’s gross salary. No tax is charged on the first…
A: Check further steps for the answer :
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Program Instructions:Take car's miles/gallon and gas dollars/gallon as input using scanner…
Q: You are required to write a pseudocode and draw a flowchart for a program to determine total marks…
A: The Pseudo Code to implement the given program is: START Declare the variable to store Username as…
Q: ). The force of gravity is different for each planet of the nine planets in our solar system. For…
A: #include<iostream>#include<bits/stdc++.h> #include<string>using namespace std;…
Q: 02 the distance between two points (x1, y₁, Z₁) and (x2, y2, Z2) in a three dimensional Cartesian…
A: Note : since programming language is not mentioned we are providing solution in c++ language. please…
Q: Finish the following c++ code by following the instructions Your program is to work as follows:…
A: A C++ program for the given criteria is as follows, #include<iostream> using namespace std;…
Q: salesman in XYZ company is selling toothpaste for P89.75 each and tooth powder for P155 95 each. The…
A: Flowchart is given in next step:
Q: If you know the balance and the annual percentage interest rate, you can compute the interest on the…
A:
Q: Assume that a runner runs 15 kilometers in 50 minutes and 30 seconds. Write a program that displays…
A: #include<iostream> using namespace std; int main(){ int distanceTravelledInKMS=15;…
Q: Two prices have already been assigned in a program. If price_1 = 35799.19 and price_2 = 42539.57,…
A: format() is used to print any number in specified format
Q: (c) You are required to create a program that reads a letter of the alphabet from the user. If the…
A: We want to check if the letter input is vowel or not, for y we have added a check, and printed…
Q: 1- If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: The C programming language is a computer programming language that was developed to do system…
Q: A customer in a store is purchasing five items. The prices of the five items are: Price of item 1 =…
A: Use an array to store the 5 prices and then we can iterate using loop and print those values
Q: Could you help me with this question. This course is Programming 1. This is the question, "A…
A: Question is asking about to calculate the total, subtotal and the sale Tax of the 5 items purchase…
Q: The volume of earth is approximately 1.086 * 10^12 cubic km, and the volume of Sun is approximately…
A: Answer : C# code : using System; namespace Volume { class Program { static void…
Q: speed=input("Enter your speed in mph: ") speed = int(speed) distance = input("Enter your distance in…
A:
Q: Write a program that accepts the input code from user and print according to the input code. If the…
A: #include<iostream> #include<iomanip> int main(){ int n; cin>>n;…
Q: A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $1 per…
A: #include <stdio.h>#include <stdlib.h> double calculateCharges(double hours) { double…
Q: Design a program that asks the user to enter an object's mass, and then calculates its weight. If…
A: The "if" conditional statement: The conditional statements control the flow of the execution of the…
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:
C-PROGRAM:: Q3
Step by step
Solved in 3 steps with 1 images
- A country charges income tax as follows based on one’s gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows: 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person’s salary and print the amount of tax to be paid in dollars. Additional information: You may assume all data entered into your program is correctA country charges income tax as follows based on one’s gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows: 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person’s salary and print the amount of tax to be paid in dollars. Additional information: You may assume all data entered into your program is correct Write this program in C#Could you help me with this question. This course is Programming 1. This is the question, "A customer in a store is purchasing five items. Write a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent." Round your output to two decimal places.
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }The following table shows the approximate speed of sound in air, water, and steel:Write a program that asks the user to enter “air”, “water”, or “steel”and thedistance that a sound wave will travel in the medium. The program should thendisplay the amount of time it will take. You can calculate the amount of time ittakes sound to travel in air with the following formula: Time = Distance / 1,100You can calculate the amount of time it takes sound to travel in water with the following formula:Time = Distance / 4,900You can calculate the amount of time it takes sound to travel in steel with the follow- ingformula:Time = Distance / 16,400I'm stuck on this problem, and here's what I'm stumped on: Meadowdale Dairy Farm sells organic brown eggs to consumers in the surrounding area. For a dozen eggs, it charges $3.25, and for individual eggs that are not part of a dozen, it charges 45 cents each egg. Using the following phrasing, write a program that prompts a user to enter the number of eggs in the order and then displays the amount owed along with a detailed explanation of why the amount is due: You placed an order for 27 eggs. There are 2 dozen eggs at $3.25 per dozen and 3 loose eggs at 45 cents each, which adds up to a total of $7.85.
- Scientists measure an object’s mass in kilograms and its weight in newtons. If you know the amount of mass of an object in kilograms, you can calculate its weight in newtons with the following formula: weight = mass × 9.8 Write a Python program that asks the user to enter an object’s mass, and then calculates its weight. If the object weighs more than 500 newtons, display a message indicating that it is too heavy. If the object weighs less than 100 newtons, display a message indicating that it is too lightFinish the following c++ code by following the instructions Your program is to work as follows: Display a welcome message (e.g., “Welcome to Airlines!”) Prompt the user to input his/her destination: Chicago, Miami, or Portland (I recommend you use letters to represent each input) Prompt the user to input what time s/he wishes to travel (in army time, e.g., 800 for 8am or 1530 for 3:30pm) Prompt the user to input what type of day (s) s/he is traveling: Weekday or Weekend (I recommend you use letters to represent each input) Report the price per ticket of the specified type Prompt the user for the number of tickets to be purchased If the number of tickets is fewer than 0, report that the number of tickets ordered is invalid and the order has been cancelled, then exit; otherwise: Compute and display the total amount due (no sales tax this time!) Prompt the user to enter the amount s/he is paying If the amount paid is less than the amount due, report that the amount paid is…Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("%.2f", yourValue);
- A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $1 per hour for each hour or part thereof over four 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 will calculate and print 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 calculate Charges to determine the charge for each customer.Assume you have $2250. You plan to invest it at 6 percent interest per year. How many years will it take before you have at least 4 times as much money as you had initially? Write a program to calculate this number of years as an integer and paste the answer your program calculates into Brightspace. A hint: If you started with one dollar at 6 percent interest annually, you would have $1.06 after one year and $1.12 after two years, compounding annually and rounding to cents. Do not round your final answer (i.e. if you compute that it will take 12.98 years to reach your desired total you should input the value 12 as your answer)The following table shows the approximate speed of sound in air, water, and steel: Write a program that asks the user to enter “air”, “water”, or “steel” and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: Time = Distance / 1,100 You can calculate the amount of time it takes sound to travel in water with the following formula: Time = Distance / 4,900 You can calculate the amount of time it takes sound to travel in steel with the following formula: Time = Distance / 16,400