Q#1 (a). Write a program that inputs radius and user choice. It calculates volume of a sphere using the following formula Volumeer vome jer ,if the user enter a V as a choice and It calculates Circumference using the following formula C- 2er, if the user enter a C as a choice.
Q: User defined Function: Return Value 4. Create a programcompute the area ofthe followingpolygons…
A: the code is given below :
Q: From 2/b/write a program in C++ language, to calculate the income tax for a person whose daily…
A: ALGORITHM:- 1. Take inout for the salary from the user. 2. Calculate the tax debit as per the slab…
Q: Python code Write a function that, given two integers, return the product of every integer between…
A: As per our guidelines we are suppose to answer only first question. Kindly repost other question…
Q: Q3: The volume of a circular cylinder V=rtr?h, write a program to compute the volume if r=8m and…
A: Objective: This program designs a class to create cylinders for a given height and radius. The…
Q: d. Given that an int variable s has been initialized, write a statement(s) that declares a new…
A: d) int s1=(9*(s-8))%4
Q: Write function avg_highest that takes 3 floating values called x, y and z as parameters abs returns…
A: #function to return average of two most large numbers def avg_highest(x, y, z): sum = 0 # if…
Q: Assume a function F1 is defined with the heading: int F1(int a, double &b, double t[]); Assume…
A: function heading int F1(int a, double &b, double t[]); and variables defined are : int a1:…
Q: 4. Write a function to compute the following: i.e. the area and perimeter circle as given below. No…
A: import math #to use value of pidef areaperi(r): area = math.pi*r*r perimeter = 2*math.pi*r…
Q: Write a C++ program that calculate and display the total fee for B.Sc. program in Engineering…
A: This question from the subject c++ where we have to use function and variables each for one entry.…
Q: Question 12: Code the given problem using python The Physics teacher in Alexandra's class is…
A: Answer in step2
Q: Write C# program for the following: Salman’s basic salary is input through the keyboard, his…
A: Lets see the solution.
Q: 1. Write a c++ programto calculate the parking fare for customerswho park their carsin parking lot…
A: Explanation: type_of_vehicle, hours and minutes are the variables used to store data by user. Then…
Q: NEED CODE IN C++ IN VISUAL STUDIO AND OUTPUT Write a program to print the factorial of a number…
A: Sample Response: //C++ program of factorial #include<iostream> using namespace std;//main…
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: Question 12: Code the given problem using python The Physics teacher in Alexandra's class is…
A: Given:
Q: Q1: Define a function called sign which takes a numerical argument and returns -1 if it's negative,…
A: The Python code for the question is given below. Also, a snapshot of code and output is provided.
Q: Write a c# program to calculate and print the bill of a given customer. [2] The customer id., name…
A: C# CODE: using System;class HelloWorld { static void Main() { //taking input…
Q: 39. Write a program for the following problem. An instructor needs a program that accepts a student…
A: Given : semester average grade 90 -100 A 80-89 B 70-79…
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: Introduction:- Below is the complete solution with explanation for the given question in detail.…
Q: Write a function that accepts weight in pounds and returns the equivalent weight in kilograms where…
A: Algorithm: Start Read weight in pounds Implement method convert() which takes weight in pounds as…
Q: Write a function NumberOfPennies() that returns the total number of pennies given a number of…
A: I give the code in Cpp along with output and code screenshot
Q: In Python Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon…
A: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):…
Q: 4- write a program C++ that accepts a character as input and determines whether the character is an…
A: Please find the answer below :
Q: Question 2: Write a program which calculate the function of F where F=Cx3 + Dx² + Ex+F And…
A: PROGRAM CODE: import java.util.*; // import the java utility packagepublic…
Q: 8: PGandE.cpp) Consider a gas and electric bill that sets two levels of use as follows: Gas Electric…
A: Coded using C++.
Q: Write the function that returns the number of days he needs to buy the cost of his first car. Jayesh…
A: In this problem, we need to design a program in java programming and show into the above desired…
Q: Q1. Write a C++ program which initializes the earning of an employee. The program should calculate…
A: NOTE: As per the guidelines, we are allowed to answer only one independent question per post. Kindly…
Q: 2.14 LAB: Expression for calories burned during workout The following equations estimate the…
A: as per Bartleby guidelines we are supposed to answer?️ only one question. Kindly repost other…
Q: 4- write a program C++ that accepts a character as input and determines whether the character is an…
A: Program: #include<iostream>#include<conio.h>using namespace std;int main (){ char c;…
Q: 2. Pure Gems Store sells different varieties of gems to its customers. Emerald, Ivory, Jasper, Ruby,…
A: Python program to solve the given problem is below.
Q: From 2/ b/write a program in C++ language, to calculate the income tax for a person whose daily…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: 8. The dynamics of a comet is governed by the gravitational force between the comet and the Sun, f=…
A:
Q: Q15/ Write a program in c++ to display the message: "PROCEED" or "ABORT" depending on the input. If…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: Write a C++ full program that calculates the average score of each student as well as the grade for…
A: Hello student, hope you are doing good. The c++ code of the given question is attached below.
Q: Q3/ Write a program to compute and display a person's weekly salary as determined by the following…
A: Given : To write a c++ program to compute and display a person's weekly salary as determined by the…
Q: 3. An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program to…
A: // C++ program #include <iostream> using namespace std; //takeinput function int…
Q: 3. A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: Ans: Code: score = int(input("Enter the exam score:"))if score > 90 and score < 100:…
Q: Question 12: Code the given problem using python The Physics teacher in Alexandra's class is…
A: Here is the detailed and simplified python code for the given question:
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Step 1 The code is given in the below step
Q: Write a program in c++ to display the message: "PROCEED" or "ABORT" depending on the input. If the…
A: The C++ program should display "PROCEED" for user input character "g". If the character entered is…
Q: 4- write a program C++ that accepts a character as input and determines whether the character is an…
A: user have to input the character. program determine whether it is a uppercase letter or lower case…
Q: Part II: Write a program to calculate the area of a triangle given the length of its three sides-a,…
A:
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: Since the values aren't given with the question, we write the program to find f for any values of…
Q: e of cube using constructor an
A: Code: #include<iostream>using namespace std; class cube{ public: double side; double…
Q: Write a function that computes a future investment value at a given interest rate for a specified…
A: Below is the required python program. Program Approach: Declare a futureInvestmentValue function…
Q: PROGRAM DESCRIPTION Make a program that accept employee number, employee name, job code (A/B/C) and…
A: First, we will input the name, job code, number, and hours worked. Based on Job code and hours…
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: C++ Exercise 30 defines the number e and Exercise 31 shows how to approximate the value of e using…
A: #include <iostream> using namespace std; float cal(int i, int n) { if(i == n) return ((i-1) +…
Q: 2. Create a program that will display the area of the following using functions: a. triangle b.…
A: #include<iostream>using namespace std;//function prototypefloat getSquarearea(float…
Q: Problem #2: [50 pts] Write a program that calculates the net salary after tax deduction according to…
A: Code and output is given in step2
Step by step
Solved in 3 steps with 2 images
- C++ 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.Q14/ 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 in c++ 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.3. Write a program to take input for a number, if the number is palindrome, then display its half on the screen, otherwise take input for 2 more numbers, and display their product on the screen. Use minimum two functions including main function.
- Q17/ 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.ASuppose that x and y are variable names that already refer to Boolean values.Write an expression (not a statement!) that evaluates to True iff at least oneof the variables is False.B.Suppose that x, y, and z are variable names that already refer to Boolean values.Write an expression (not a statement!) that evaluates to True iffat least two of the three variables (x, y, z) are True.C. Consider the following function headers and type contracts:def aragorn(x: int, y: str, z: float) -> str:def gandalf(x: list) -> list:def elrond(x: list, y: bool) -> bool:If the following code runs without errors, what is a header and type contractfor treebeard?a = aragorn(11, 'good', 2.0)b = treebeard(5, gandalf([1, 2, 3]), a)print(elrond(gandalf([4, 5]), b))Write the header and type contract for treebeard.Question 4 Write a C++ program that evaluates Ly=b and then Ux=y. L and U are the upper and lower triangular matrices of a square matrix A. b is a set of randomly generated numbers. Solve the equations to get the solution x. Full explain this question and text typing work only thanks
- C++ Programming Exercise: Ther are 50 apartment units. When the rent is $600 per month, all the units are occupied. However, for each, $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.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.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; }
- (Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.(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.d. Given that an int variable s has been initialized, write a statement(s) that declares a new variable andassign it the remainder of 9 times 8 less than s divided by 4. e. Write a statement(s) that initializes the variables named a, b, c and d to false, ''one'', 'y' and 87.9respectively