1. Problem: write a complete program to calculate the total price of an item by asking the user to input the price and quantity of the item. 2. The main () function will prompt the user to enter the mass and volume of a block. function findDensity() will receive the mass and volume and will calculate and return
Q: 2.1.1: Reading multiple data types Type two statements. The first reads user input into…
A: Given: 2.1.1: Reading multiple data types Type two statements. The first reads user input into…
Q: PROBLEM 2: Using user defined function and appropriate conditional and looping statements, create a…
A: The program is written in C++. Please find the source code in the below steps.
Q: a. The main part of the program will call a user-defined function. b. Inside the function do the…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: Problem #2: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To…
A: As no programming language is mentioned, writing this program in c++ Code : #include…
Q: The first integer is number of reading from the data file. Write a complete C++ program to: • Read…
A: The program is written in C++. Please find the source code in Step 2.
Q: Problem 4 Write a program called p4.py. Fill in the rest of the program, making use of the functions…
A: Solution for the given problem: In this already a list of maximum word is given then computer…
Q: Miles to track laps One lap around a standard high-school running track is exactly 0.25 miles. Write…
A: Actually, program is an executable software that runs on a computer.
Q: Write a program whose inputs are three integers, and whose outputs are the largest of the three…
A: A Corel is a simple high level programming language. It is also used for making flowchart. We type…
Q: Question 8: Write a C++ program to calculate net pay of an employee. Input basic pay from user, and…
A: Please go through the code for better understanding. Code snippet is attached below the typed code.…
Q: Analyse the following segment code. Assume all preprocessor directives and main function are defined…
A: Here the variable k is initialized to value 5.1 And later on we are trying to change the value of k…
Q: Problem 2: This program will compute the volume of a cylinder. Write a function, area, that will…
A: As programming language is not mentioned we are providing answer in C++ language.…
Q: A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number…
A: Working CODE: user_steps = float(input("Enter the steps")) def steps_to_miles(user_steps): miles…
Q: Problem #1: Write a program that reads from the user the name of a student, the grades of two…
A: Simple output, Your name: Ali your midters 1 grade: 70 your midterm 2 grade: 65 your final year…
Q: Write a function that accepts two arguments, double and char, which are defined as two variables…
A: Program code: //include the required functions #include <iostream> using namespace std;…
Q: The following represents sales data of 10 bubble tea stands for a given shift. sales = [45, 49, 55,…
A: NOTE: According to the guidelines, the first 3 questions are answered 1. Python code for the…
Q: 3. Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2.…
A: Functions required:- convertToF() convertToC() Formula used f=(9/5)*c +32 Formula used…
Q: A] ( its) If you know that the cross-sectional areas for different columns are defined by the matrix…
A: A. Stress=load/area Code:…
Q: Using Function loading a) Make a list of five diseases and their respective treatment. Enter your…
A: Need to write C++ program using function loading It should have list of five disease with their…
Q: (a) ask the item price from the user (b) ask how many items to purchase for a specific item price…
A: As we are not sure about the number of items, to be added we can make use of loops to accept input…
Q: give the following recursive function and call, provide output and the details regarding the memory…
A: - We need to code for recursive payment method.
Q: 1. Write a complete C++ program to prompt a user to enter the working hours and rate per hour.…
A: Given Total_salary=working hours* rate per hours To write c++ program to calculate total salary
Q: In a triangle, the sum of the 1st and 2nd side must always be greater than the 3rd side. Create a…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: a. The main part of the program will call a user-defined function. b. Inside the function do the…
A: The complete answer is solved using concepts of Function calls in the Python Programming.
Q: Question D. Write a C++ program that computes the factorial of a given positive integer (n!). The…
A: CPP program to compute the factorial of a given positive integer (n!). Prompt the user to enter the…
Q: main.cpp |/ Write function which will return true if someone is selected and false if rejected for…
A: We need to write a C++ program for the accept student for internship in the company depend on the…
Q: Q1)Write the function definition for areaOfCircle() which prompts and reads radius then calculate…
A: Since programming language not mentioned, using C++
Q: 6.29 LAB: Max and min numbers Write a program whose inputs are three integers, and whose outputs are…
A: Answer: step 1: take three inputs step 2 : define two functions one for finding largest among three…
Q: write a program to display the squares of all even and odd numbers from X to Y .
A: The c program is written where it displays the squares for all even and odd numbers based on input…
Q: Program 2: Write a Python program to accept employee name and basic salary of n number of employees…
A: def calculate_allowance(basic_salary): """returns allowance value for given basci_salary"""…
Q: Problem 1. Write a program to calculate the real roots of the quadratic equation. Note: use…
A: As per our company guidelines, we are supposed to answer only one question per post and kindly…
Q: 2) The ceiling of a floating-point number x is the smallest integer that is still larger than or…
A: Actually, python is a easiest programming language. It is a structural and object oriented…
Q: Using C. This question deals with determining the slope and the mid-point between two points in a…
A: #include <iostream>using namespace std; void determineSlopeMid(int x1, int y1, int x2, int…
Q: 3. Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2.…
A: The given problem is to be solved in C++ language where the conversion of the temprature will be…
Q: Complete the following program. An object floats in any fluid, if the density of the object is lower…
A: The program illustrates calculating density and printing the message based on the given constraint.…
Q: Use the Design Recipe to define a function pulse_rate that has two parameters. The first is the…
A: Please find the answer below :
Q: Assume on a planet called “Chocolatey”, 1 month = 20 days and 1 year = 240 days = 12 months. Write…
A: - We have to write the code in python to get the difference in days for the given conditions.
Q: 1.) Write a function-oriented program that calculates the power value of the input base number and…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: If the second input is higher than the first input but lower than the third input, what will be the…
A: For a quadratic equation of the form; ax2+bx+c=0; the roots of the equation are derived as; x =…
Q: The Graduation Problem Many 4-year Universities are on the quarter-credit (rather than semester)…
A: Program to implement the following problem: string getStatus(double gpa,int credits, int…
Q: Using user defined function and appropriate conditional and looping statements, create a program…
A: CODE:- #include<iostream>using namespace std;int payment(int tot){ int paym; do{…
Q: Problem 2. (Playing the Waltz) Write a program called playwaltz.py that accepts from standard input,…
A: Write a program playvalt2.py that accepts from standard input, a sequence of 32 integers…
Q: Question 2) Program a function named isprime() by C program that inputs an integer number and…
A: #include <iostream>using namespace std;bool isPrime(int num); int main(){ int num; bool…
Q: 1-Suppose x and y are int variables and z is a double variable. Assume the following input da 37…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: C program to to convert binary numbers to decimal by creating a user-defined function. do fast with…
A: Question :
Q: Write a program that does basic arithmetic operations (addition, subtraction, multiplication, and…
A: Program: # include <iostream>using namespace std;double addition(double n1, double n2){…
Q: 1. write a C program that will do the following : • Ask the user to enter 2 float values • Create a…
A: here in this question we have asked to write a program in c which take two float value and swap…
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
Q: Write a program that does basic arithmetic operations (addition, subtraction, multiplication, and…
A: A C++ program for the given criteria is as follows, File name: “main.cpp” #include <iostream>…
Q: Program 2: Write a Python program to accept employee name and basic salary of n number of employees…
A: # Method for Calcualting Allowanancedef calculate_allowance(basic_salary): """returns allowance…
Step by step
Solved in 2 steps with 2 images
- (Practice) For the following function headers, determine the number, type, and order (sequence) of values that should be passed to the function when it’s called and the data type of the value the function returns: a. int factorial(int n) b. double volts(int res, double induct, double cap) c. double power(int type, double induct, double cap) d. char flag(char type, float current, float time) e. int total(float amount, float rate) f. float roi(int a, int b, char c, char d, float e, float f) g. void getVal(int item, int iter, char decflag, char delim)(Statistical) In many statistical analysis programs, data values considerably outside the range of the majority of values are simply dropped from consideration. Using this information, write a C++ program that accepts up to 10 floating-point values from a user and determines and displays the average and standard deviation of the input values. All values more than four standard deviations away from the computed average are to be displayed and dropped from any further calculation, and a new average and standard deviation should be computed and displayed.(Numerical) Heron’s formula for the area, A, of a triangle with sides of length a, b, and c is A=s(sa)(sb)(sc) where s=(a+b+c)2 Write, test, and execute a function that accepts the values of a, b, and c as parameters from a calling function, and then calculates the values of sand[s(sa)(sb)(sc)]. If this quantity is positive, the function calculates A. If the quantity is negative, a, b, and c do not form a triangle, and the function should set A=1. The value of A should be returned by the function.
- Question 1 This question deals with multiplying a 2 X 3 matrix by a 3 X 2 matrix. Your job is to input matrix A, followed by matrix B, then produce matrix C which is the product of A and B. At run time, please use the following for matrix A 1 2 3 4 5 6 followed by the following data for matrix B: 6 5 4 3 2 1 Your program should input the values for A and B in function main, then call a function matrix_mult to produce matrix C which consists of the product of A and B. Please use the following for naming your variables: Ar1c1, Ar1c2, Ar1c3. ..., where Ar1c1 refers to row 1, column 1 of matrix A, etc. (There will be a lot of variables). Do not use arrays to solve this problem.Define a function named CoinFlip that returns "Heads" or "Tails" according to a random value 1 or 0. Assume the value 1 represents "Heads" and 0 represents "Tails". Then, write a main program that reads the desired number of coin flips as an input, calls function CoinFlip() repeatedly according to the number of coin flips, and outputs the results. Assume the input is a value greater than 0. Hint: Use the modulo operator (%) to limit the random integers to 0 and 1. Ex: If the random seed value is 2 and the input is: 3 the output is: Tails Heads Tails The program must define and call the following function: string CoinFlip()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.
- (Please use JAVA)Command Line Calculator The program will ask the user to select a function from 1-5 (1-Add, 2-Subtract, 3-Multiply, 4- Divide, 5-Exit the program). Afterwards, the program asks for two inputs from the user and prints out the result of the two numbers given which operation the user selected. After printing the result, loop back to asking the user to select a function again until he enters 5 to exit the program. Try to complete this task using methods for each function and using loops.A bullet train slows from a speed of 200 mi/hr to 150 mi/hr in one minute. Write a computer program that calculates the bullet train’s constant rate of acceleration and determines how long the bullet train will take to come to rest, given an initial speed of 200 mi/hr. (Hint: Use the equation a = vf - vi t where a is acceleration, t is time interval, vi is initial velocity, and vf is final velocity.) Write and call a function that displays instructions to the program user and a function that computes a, given t, vf, and vi. using c programming language11.5.1: Max and min numbers. Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. If the input is 7 15 3, the output is: largest: 15 smallest: 3 Your program should define and call two functions: Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNum Function SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum The function LargestNumber should return the largest number of the three input values. The function SmallestNumber should return the smallest number of the three input values. Need program written in coral language
- Write code to ask the user to enter a positive integer (N) in the main() function. Write a function sequence() that receives the integer value N and display the ‘3N+1’ sequence starting from the integer value that was received (entered by the user). The function must also count and return the numbers that the sequence consists of. The returned value must be displayed from the main() function.6.29 LAB: Max and min numbers C++ Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two functions. The LargestNumber function should return the largest number of the three input values. The SmallestNumber function should return the smallest number of the three input values.int LargestNumber(int num1, int num2, int num3)int SmallestNumber(int num1, int num2, int num3)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.