(You should do the previous two
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Absolute C++
Additional Engineering Textbook Solutions
C++ How to Program (10th Edition)
Starting out with Visual C# (4th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out With Visual Basic (7th Edition)
Programming in C
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
- Q4: the volume of a cylinder is given by the formula: V=r 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.arrow_forwardDo not use global variables for this assignment Choose descriptive variable names in all programs. Currency format. There should be no space between the $ sign and the first digit. In python, Write a program that uses a custom function named as you wish and the main function. In main, prompt the user for a first name and an integer less than 10 and then execute the custom function with these two inputs as arguments. The custom function should output one line displaying the name as many times as specified by the integer, separating each repetition of the name with a space.arrow_forward// // 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);arrow_forward
- Write a function that adds two numbers. You should not use+ or any arithmeticoperators.arrow_forwardThe following program will prompt the user for a starting number and an // ending number. Assume that these are whole numbers (no decimal points), // assume the numbers are not negative and assume that the first number is // not larger than the second number. // // write a funcTion that returns the sum of the numbers from the starting // number to the ending number. For example, if the starting number is 13 // and the ending number is 18 then the function will return the value of // 13 + 14 + 15 + 16 + 17 + 18. If the starting number is equal to the ending // number then simply return that number. // ////////////////////////////////////////////////////////////////////////// function sumOfNumbers(startingNumber, endingNumber) { } var startingNumber = parseInt(prompt('What is the starting number? ')); var endingNumber = parseInt(prompt('What is the ending number? ')); var sumOfNumbersPassed = sumOfNumbers(startingNumber, endingNumber); alert('The sum of the numbers from ' +…arrow_forwardComplete 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…arrow_forward
- Code in Pythonarrow_forwardUSE C++programming languagearrow_forwardThe first expert's answer is incorrect, need help using Python3 pleaseee. Note that: - Numerical grades are college grades. - The code is already given in the photo below, do not modify. Thank you expert this is really a great help to my learning.arrow_forward
- Write a main function that performs the following: • Prompts user to enter 2 integer values A and B. • if the first number A is greater than to B+5, the main function prints out the result of 6 multiplied with the every odd number from 1 to B... • If the first number A is less than or equal to B+5, the main function prompts the user A times to enter grades in a variable called grade and print their summation. • If not, it prints out "No output to be given".arrow_forwardA triangular number is defined as m(m + 1)/2 for m = 1, 2, c , and so on. Therefore, the first few numbers are 1, 5, 12, 22, . . . . Write a function with the following header that returns a triangular number: int getTriangularNumber(int n) Write a test program that uses this function to display the first 75 triangular numbers with 5 numbers on each line.arrow_forwardWrite a program that accepts as input: a.)miles you have driven b.)miles per gallon, car efficiency c.)gas cost per gallon. Your program the invokes the XXX( ) function which computes and returns how many gallons of gas you have consumed to drive those miles. Then your main program continues and computes the cost of the consumed gas and displays that cost. See below. Replace the XXX ( ) function name with whatever name you want and decide about the parameters. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'{your_value:.2f}')arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,