Write a program that accepts from the user a unit price of a certain product and the quantity of that product bought by a customer. It should compute and display the amount payable.
Q: Suppose you are a surveyor. Your job requires you to study some maps that give distances in…
A: To Do: a program to convert distance. by using - pass by value -pass by reference
Q: write a program in C++ that Mr. Ali has invested an amount of Rs101, 876 in a Bank scheme. Bank…
A: Introduction of the Program: The C++ program calculates the total amount after 7 years using the…
Q: Write a program in c++ that will allow a user to find the hypotenuse of a right triangle using the…
A: Given: We have to write a a program in c++ that will allow a user to find the hypotenuse of a…
Q: Write a C program to perform the following using if else ladder or switch statements. The program…
A: Required: Write a C program to perform the following using if else ladder or switch statements.…
Q: Write an OOP C++ program that will complete the following: Prompt the user to enter an integer 0 to…
A: C++ is an object-oriented programming language that means it supports the class and object model. A…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: Please find the answer below :
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: Read and understand the following problem: 1. Write a program that accepts from the user a…
A: val = int(input("Enter the Weight Of Object: ")) // declared a variable val that will take the…
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: For the given points (1, 2, 3), (3, -4, -5) and (-4, 2, -6) The rij is the distance between charges…
Q: Write a program which calculates the balance of a savings account after the first three months. To…
A: The question has been succesfully solved with Screenshot of code and output with 100%…
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: Write the pseudo code for this problem based on what you learned from the video. The purpose is to…
A: - The question is to write the pseudocode for the problem of conversion from kilometres to miles.
Q: Read and understand the following problem: 1. Write a program that accepts from the user an…
A: Suppose the user entered 100 Peso. Given: 1 HK dollar = Php 6.51 ⇒ 1 Php = 1/6.51 HK dollar…
Q: (b) What is the value of x after each of these statements is encountered in a computer program, if x…
A: Given: X value after statements was encountered.
Q: Write in symbolic form: For all integers x,there exists an integer y such that the sum of x and y…
A: A symbolic form of quantifier use symbols like ∀,∃ etc. to represent the statement. It help to…
Q: 1. In the game of Monopoly, a pair of dice are rolled to move a player's piece around the board. If…
A: %fifty times rollingplayer1_total_double = 0;player2_total_double = 0;player1_totalSteps =…
Q: 1)Write program to make simple calculator? The program input two number and one character? a) print…
A: As programming language is not mentioned i am providing you the answer in C++.
Q: 1. Write a program that prints your name, age, and department in console 2. Write a program that…
A: As no programming language is mentioned, it is solved using C++
Q: Write a C program to perform the following using if else ladder or switch statements The program…
A: #include<stdio.h> int main() { float omani; int choice; char name[50];…
Q: Write a program to calculate the electricity bill. The rates of electricity per unit are as follow:…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write a program that will accept user's info: fullname,age,course abd section. Display all the…
A: 1. Flow chart Source Code import java.util.Scanner; class ReadInfo { public static void…
Q: Problem 2: Write a Java program to perform the following: Present the user with a menu of selections…
A: The JAVA code is given below with code and output screenshots switch statement is used in the code
Q: Write a program that will makes simple calculations. Use function for each operation.
A: To write a program that will makes simple calculations using function for each operation.
Q: Write Java program that asks the user to enter an integer number than accomplish each of the…
A: Java Code for the above problem program is in next step and outputs are also attached in which we…
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: In C++, write a program whose inputs are three integers, and whose output is the smallest of the…
A: Given To complete the c++ program to find the smallest numbers from three integers.
Q: I need to create a program called Hello.java In the program, declare a function: public static void…
A: GIVEN: I need to create a program called Hello.java In the program, declare a function: public…
Q: Using any programming language, write a program that will solve the given problem below: Write a…
A: The answer is coded in Python Language.
Q: Write a java program to calculate the following: Check whether the given number is prime no or not,…
A: INTRODUCTION: In the given problem, we are asked to write one java program with function overloading…
Q: Write a program that asks for the borrower's lastname, borrower's first name, borrower's middle…
A: According to the question there is no specific programming language mentioned. We have solved the…
Q: Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time…
A: Note: As no language is mentioned, therefore answering the given question in python. Input : age…
Q: reate a JAVA program that prompts the user to enter a numerical test mark and displays the…
A: Here I have taken input from the user and then used the if-else block to first validate it. Then, I…
Q: Write a program that takes balance of a user's account as input.it should then ask the user how much…
A: The answer is given in next step:-
Q: You decide to buy some stocks for a certain price and then sell them at another price. Write a…
A: Write a program that determines whether or not the transaction was profitable. If your transaction…
Q: Write a python program that takes three integer command line and write 'equal' if all are equal and…
A: Python provides a getopt module that helps you parse command-line options and arguments. $ python…
Q: Write a program c language to calculate electricity bill charged to a consumer. Ask him to enter…
A: The main objective of the C- program,main.c is to prompt users to enter the number of units…
Q: Write a program that takes integers as arguments and adds them. b. Write a program that takes…
A: #include <iostream>using namespace std; //function declarationint addition(int a,int b); int…
Q: Create a program that tells you how much money you have left after some expenses. Use these steps as…
A: To solve this problem,you have a function aaa which will prompt the user for expenses.After that…
Q: The production figures for five oil wells in seven different regions are input one by one. The…
A: Introduction: Input all the production amounts in lists and you can use in built sum function for…
Q: 3. Write a program that checks the screen time of a child and repeats, this procedure three times.…
A: #include<stdio.h>int main(){ int age; float screen_time; for(int i=0;i<3;i++){…
Q: Write a program to find out the grade of a student based on the marks obtained in three subjects.…
A: As the programming language is not mentioned so, I am using C language to write a code. If you want…
Q: Write a program that would compute the sum, difference, product, quotient, and will print the…
A: As no programming language is mentioned, it is solved using C++
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: to do: Write a program in C++ to calculate and print the Electricity bill of a given customer.…
Q: C++) Write a program with total change amount as an integer input, and output the change using the…
A: /*Write a program with total change amount as an integer input that outputs the change using the…
Q: Write a program that will input 2 fractions and compute the display the sum of the two fractions.…
A: The answer is
Q: Write a program that reads from the user the initial Kilometers of the car, the current Kilometers…
A: Required: Write a program that reads from the user the initial Kilometers of the car, the current…
Q: Write a program to calculate electricity bill charged to a consumer. Ask him to enter the units…
A: Note: Programming language is missing in the question. So we will answer this program in Java…
Q: 1. For this problem, you are going to design a game for the children to teach them about numbers.…
A: The above problem statement can be solved by involving Do-While loop in the program. This loop will…
Read and understand the following problem:
1. Write a
note: discuss or explain the solution of the problem
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images
- (Modify) a. Modify the program you wrote for Exercise 7 to provide the mass of a person as an output, given his or her weight as an input to the program. Use your program to determine the mass of a person who weighs 140 lbf on Earth. b. Modify the program written for Exercise 7a to also output the person’s weight on Mars and the moon. The pull of gravity on Mars is 12.54ft/sec2=3.728m/s2,andonthemoonis5.33ft/sec2=1.625m/s2.Read and understand the following problem: 1. Write a program that accepts from the user an amount in Peso. It should compute the equivalent amount in HK dollar, US dollar and Canadian dollar. Display the amount in Peso and the equivalent amount in the different currencies. Given: 1 HK dollar = Php 6.51 1 US dollar = Php 50.68 1 Can. Dollar = 40.06 note: discuss or explain the solution of the problemC++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.
- Read and understand the following problem: 1. Write a program that accepts from the user a weight of an object in kilograms. The program should compute the equivalent weight in grams, milligrams and metric tons. It should display the weight in different units (grams, milligrams and metric tons). Given: 1 metric ton = 1000 kilograms 1 kilogram = 1000 grams 1 gram = 1000 milligrams note: discuss or explain the solution of the problemRead and understand the following problem: 1. Write a program that accepts from the user a unit price of a certain product and the quantity of that product bought by a customer. It should compute and display the amount payable. note: discuss or explain the solution of the problem use this: #include <stdio.h> int main()An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The spilled oil sits on top of the water and causes a natural disaster. For simplicity, suppose that the oil sits on top of the water in the form of a circle. Write a program that prompts the user to enter the rate at which the ruptured pipe pumps oil (in gallons) per minute, the thickness of the oil on top of the water, and the number of days for which the area is covered by the spilled oil. The program outputs the spilled area (in kilometer) and the volume of oil (in gallons) on top of the water after each day.
- 2- Write a Python program that determines a student’s grade. The program will read three types of scores(quiz, midterm, final exam scores) and determine the grade based on the following rules : if the average score >=90% =>grade=A -if the average score >= 70% and <90% => grade=B -if the average score>=50% and <70% =>grade=C -if the average score<50% =>grade=F Example Input : Quiz score: 80 Mid-term score: 68 Final score: 90 Output: Your grade is B.Write a program that computes the cost of painting and installing carpet in aroom. Assume that the room has one door, two windows, and one bookshelf. Your program must do the following:a. Prompts the user to enter, in feet, the length, width, and height of aroom. Read the dimensions of the room.b. Prompts the user to enter the widths and heights, in feet, of the door,each window, and the bookshelf. Read these quantities.c. Prompts the user to enter the cost, per square foot, of painting thewalls. Read these quantities.d. Prompts the user to enter of cost, per square foot, of installing carpet.Read these quantities.Problem 2 Write a program that lets the user enter an integer number and display its equivalent value in text form. The range of input values should be from -99999 to 99999. Example 1 Enter integer in range [-99999, 99999] -> 100 Expected Output Text equivalence: one hundred Example 2 Enter integer in range [-99999, 99999] -> 5 Expected Output Text equivalence: five Example 3 Enter integer in range [-99999, 99999] -> 1812 Expected Output Text equivalence: one thousand eight hundred twelve Example 4 Enter integer in range [-99999, 99999] -> 44040 Expected Output Text equivalence: forty-four thousand forty Example 5 Enter integer in range [-99999, 99999] -> -10 Expected Output Text equivalence: negative ten In [40]:
- 17. Redo Programming Exercise 16 so that the user can also input the cost of producing one liter of milk and the profit on each carton of milk.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.)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; }