Write C Program of the following. Write the program using following functions. But do as mentioned below: double circleArea(double radius) double rectangleArea(double width, double length) double triangleArea(double base, double height) displayArea(double area) also attach the screenshots of the output.
Q: Write a function that displays at the left margin of the screen a solid rectangle of asterisks whose…
A: The code is as follows import java.util.*;public class Main{ public static void main(String[] args)…
Q: Write a program in python that prints a pyramid made of letters in the middle of the screen. Use…
A: #function to print pyramind as requirement def print_pyramind(c): #Defining string to print…
Q: Given below is a C++ function: string my_date(int dd, int mm, int yyyy){ //return a string of the…
A: Here I have created the function named my_date(). In this function, I have to_string() method to…
Q: syntax errors are corrected and any omitted statements are included.
A: void func(double x) { double y; y = x * x + 3 / 5; } The above function is a void type…
Q: Consider the following function: int mystery(int x, int y, int z) { if (x <= y && x <= z && x != 0)…
A: PROGRAM: //Header file #include <iostream> //Using namespace using namespace std;…
Q: Create a function that takes a number a and finds the missing exponent x so that a when raised to…
A: Please find the answer below :
Q: 3. Write a program which takes two integers and print their sum, subtraction, multiplication, and…
A: a program which takes two integers and print their sum, subtraction, multiplication and…
Q: Write a program to read the values of the monthly water consumption for two months and display the…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: 2.a) Write a Python function to take two integer parameters and return whether both integers have…
A: def last_same( n1, n2) : Rem1 = n1%10; Rem2=n2%10; if(Rem1 == Rem2) : print("Both…
Q: Write a function that add all odd numbers from 1 to numbers the number is specified in integer…
A: Input upper limit to find sum of odd numbers from user. Store it in some variable say N.Initialize…
Q: 4- Given the following table for letter grades and their corresponding remarks, write a JavaScript…
A: Given: Java script code for Grade: GRADE OUTPUT A You are excellent B You are good C You…
Q: write a C program named turn_to_letter that decides on the letter grade of the student according to…
A: I have provided solution in step2.
Q: Write a C++ temperature conversion program which does the following: Write a function called…
A: PROGRAM: //Header file #include <iostream> //Using namespace using namespace std;…
Q: 1. Write a function in F# that has the following function signatures: 1. string * int * int ->…
A: Write a function in F# that has string*int*int ->string 1. string *int *int -> string 2.…
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: Here I have created the function named exact_change(). Inside the function, I have first of all…
Q: Consider the function f(x, y), defined for x E R, y E R as follows: x + y for x > 0 and y > 0 { for…
A: def func_xy(x,y): if (x>=0 and y>=0): return x+y if (x>=0 and y<0):…
Q: rong with the following function? int 3integer_add( int x, int y, int z ) { int sum;…
A: In C the function name should always start with an alphabet or underscore just like any other…
Q: 2-Determine the output of the following functions (You must show your works) a. (cdaar '((( (orange)…
A: The solution for the above-given question is given below:
Q: Q4 / Write a program to read a sequence of integer numbers until a negative number is entered, then…
A: c++ programing
Q: Write a function, add_it_up(), that takes a single integer as input and returns the sum of the…
A: I give the code in python along with output and code screenshots refer it
Q: Write a function that takes in three numbers as parameters and prints out the largest of the three.…
A: Program to write a function that takes in three numbers as parameters and prints out the largest of…
Q: What is the return result of a function that lacks a return statement or has an empty return…
A: Introduction: The return value of a function is the final value that was returned back to the…
Q: Write a function void swapValue (float *one_p, float *two_p) that exchange the values of two types…
A: Please find the answer below :
Q: Write a C ++ program to make a calculator that performs division and subtraction of five numbers…
A: C++ Code for the given scenario: #include <iostream>#define N 5 using namespace std; float…
Q: Write a function to add two numbers of the integer type, provided that the name of the first…
A: As there is no programming language mentioned so program is attempted in c++ language. my name is…
Q: Write a program with two functions and a main(), each having at least two parameters. The functions…
A: The question asks to implement two functions and main() such that each of them has at least…
Q: coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular…
A: Lets see the solution.
Q: Consider the following statements: Class objects in C++ can be passed to a function, but cannot be…
A: I have given an answer in step 2.
Q: Create a functional program that can cáalculate the Euclidean distance between 3 points in space…
A: Programming language is missing in the question. So we will answer the given criteria in C++…
Q: Write two functions that implement the following conversions: a. Function celsius receives a…
A: Program: #include<bits/stdc++.h> #include <iostream> using namespace std; float…
Q: Design a program with extension .c that calculates the final grade of a student with based on: • The…
A: Algorithm: Input three grades from the user Calculate the average of the three grades Input marks…
Q: Write a program which prints the following message in the output screen by using In and \t…
A: Given, A program which prints the given message in the output screen by using \n and \t functions.…
Q: The following questions refer to the skeletal C++ program shown below. (a) Assume that static…
A: Given data is shown below: The following questions refer to the skeletal C++ program shown below.…
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: Here have to determine code to find exact change.
Q: Write a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds…
A: function sumDigits(f,t,x): Start for i in f to t follow steps 3 to 10 Number = i initialize Sum = 0…
Q: Write a function to find the best exchange rate from one currency to another currency: Given list…
A: Python Code: from collections import defaultdictfrom collections import deque # convert functiondef…
Q: Write a function number_of_pennies() that returns the total number of pennies given a number of…
A: In Python, a function is a gathering of related statements that plays out a particular errand. It…
Q: Write a C program that reads a one-digit number and then displays it to the screen as a word in…
A: To read a single-digit we need to scanf a character (%c) and convert the char to int by subtracting…
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: Code : # definition of the exact_change() method...def exact_change(user_total): # fetch the…
Q: In C program, what is wrong with the following function? int integer_add( int x, int y, int z ) {…
A: Answer: The function has a syntax error. Explanation: The given function accepts three-parameters…
Q: Consider the following C++ function. int mystery(int num1, int num2){if (num1 > 0){for (int i =…
A: C++ Program: #include<iostream> using namespace std; int mystery(int num1, int num2) { if(num1…
Q: number *= 2 Based on that, what is the output from this function call? print(doubleNumber(3))
A: THE OUTPUT OF THE ABOVE FUNCTION WILL BE D. NONE
Q: Write a program in C++ that calculates the percentage of a student's mark in the exam. using…
A: #include<iostream.h> #include<conio.h> void main() { intno, i; float marks[100],…
Q: Write a user-defined function that will receive a variable number of input arguments: the length and…
A: ## As no language is mentioned, we write the code in Python. def fun(l, w, *h):…
Q: Write a function hello(firstname, lastname), which, for example, if called with hello('James,…
A: Hi. Since you have not mentioned any programming language, I will attempt this question using…
Q: Write a program that will read the value of integer x and evaluate the following function:
A: Input value of x If x>0, assign y=1 If x=0, assign y=0 If x<0, assign y=-1 Print y
Q: True or False? 14. Consider the function f : D → C where A, B ⊆ D. If f[A] − f[B] = ∅ then f[A − B]…
A: false
Write C Program of the following.
Write the program using following functions. But do as mentioned below:
- double circleArea(double radius)
- double rectangleArea(double width, double length)
- double triangleArea(double base, double height)
- displayArea(double area)
also attach the screenshots of the output.
Step by step
Solved in 3 steps with 3 images
- 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; }In Chapter 4, you created a program that generates a random number, allows a user to guess it, and displays a message indicating whether the guess is too low, too high, or correct. Now, create a modified program called GuessingGame2 in which the user can continue to enter values until the correct guess is made. After the user guesses correctly, display the number of guesses made. Recall that you can generate a random number whose value is at least min and less than max using the following statements: Random ranNumber = new Random(); int randomNumber; randomNumber = ranNumber.Next(min, max);(Misc. application) a. Write a program to reverse the digits of a positive integer number. For example, if the number 8735 is entered, the number displayed should be 5378. (Hint: Use a do statement and continuously strip off and display the number’s units digit. If the variable numinitially contains the number entered, the units digit is obtained as (num % 10). After a units digit is displayed, dividing the number by 10 sets up the number for the next iteration. Therefore, (873510)is5and(8735/10)is873. The do statement should continue as long as the remaining number is not 0.) b. Run the program written in Exercise 3a and verify the program by using appropriate test data.
- Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula. length=v^2/2*a. write a program that prompts the user to enter V in meters and acceleration an in meter/second and display the minimum runway length.. Write a program that will calculate the account balance after we deposited the amount of money for a given period (in years) with interest rate. The program shall ask the user to input the amount (m), period (n) and interest rate (r). Write a local function that will calculate the balance (B). Display the result of the balance calculation. Use the formula below for the balance. Save program as LE9-2.m and flowchart/pseudo-code as LE9-2.png or LE9-2.txt. B=m∗(1+r)nFox International sells pre-paid calling card with the following features: Calls to USo 1.2 cents per minute plus a 49 cent connection fee per call Calls to Europeo 2.3 cents per minute plus a 49 cent connection fee per call Calls to Australiao 6.4 cents per minutes plus a 49 cent connection fee per callWrite a program that work out the charges for the month. The program should accept the followinginformation: Account holders name Card number Starting Balance on card For US callso Total number of minutes of all callso Total number of calls made For European callso Total number of minutes of all callso Total number of calls made For Australian callso Total number of minutes of all callso Total number of calls madeYou are NOT expected to error check your inputs for this assignment. (e.g. checking for negative values,etc.). There is NO GST charged on the calls as the GST was paid when the card was purchased.Format of output:Review the test plan to see how the user would like the…
- Prompt the user to enter in the three number that define a quadratic ??2+??+?=0ax2+bx+c=0, that is prompt the user to enter in numbers a, b, c. Compute the two solutions to the quadratic (i.e., solve for x). We will assume the user inputs numbers that result in a positive discriminant. Display the results.The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourlyrate. Net pay is gross pay minus taxes (Refer to the tax table on the second page).Define a class called Employee. The class must have private attributes to store the employee's name, hourly rate, and regular (≤ 40) and overtime hours worked. The class must also have methods to perform the following tasks:• A constructor to initialize the hourly rate to the minimum wage of $7.25 per hourand the hours worked (regular and overtime) to 0.0.• A method to get (a setter/mutator method)⬧ the employee's name⬧ the hourly rate⬧ the hours work for the month (by the week – assume 4…Write a program that will perform one of the following operations:1. Print the Fibonacci series from 0 to N2. Print the Prime numbers from 0 to N3. Print the Factorial of the numbers from 0 to NInclude at least the following functions in your program:• menu: a function to display the operations listed aboveo Use a switch-statement to process the user’s choice• fibonacci: a function that will print the Fibonacci series from 0 to N o Sample Input: Suppose N = 5o Sample Output: 0 1 1 2 3 5 • primeNumbers: a function that will print the prime numbers from 0 to N o Sample Input: Suppose N = 5o Sample Output: 2 3 5 • factorial: a function that will print the factorials of the numbers from 0 to N o Sample Input: Suppose N = 5o Sample Output: 0! 1! 2! 3! 4! 5! = 1 1 2 6 24 120 Include a loop that will allow the user to repeat the whole program if he wants to. PLEASE add "//" every code wirtten to explain its use in the program. thank you! do the following conditions set and DO IT IN C++
- You've decided to order a pizza for dinner. The restaurant you're ordering from has three sizes of pizza: S, M, and L. Each size has a different base price and price per topping. The prices are indicated in the table below. Create a program to calculate the total cost of your pizza. The program should prompt you for the size of pizza and the number of toppings, then output the cost. Size Base Price Price per Toppings S $4.99 $0.75 M $5.99 $1.50 L $6.99 $2.25 The input should be a character (for size) and non-negative integer (for number of toppings) and the output should be a double. Sample run: What size pizza would you like to order? S How many toppings do you want? 3 Your total is $7.24 Note: The total cost should be formatted with a two-digit precision. You can use the setprecision() function with the fixed manipulator from <iomanip> library to do so. Bad formatting: 10.8 Good formatting: $10.80 Ensure you are doing input validation similar to the last question.…1. Prompt the user and read in the number of a team playing the current game, i.e. Team 1, Team 2, Team 3, etc. 2. Prompt the user and read in the number of the opponent team. It is probably helpful to think of the first team as the home team for this game, and the second team as the away team. 3. Prompt the user and read in a team’s score for the current game. Use the team’s number when asking for the score in your printf statement. 4. Prompt the user and read in the opponent’s score for that game. Again, use the opponent’s team number when asking for the score. 5. Notify the user and repeat steps 3 and 4 in the case that the user enters a negative value. 6. Calculate the points earned by each team and add it to a cumulative score. A win is worth 3 points, a draw is worth 1 point and a loss is zero points. Also update the amount of games played by each team and their goals for and against. 7. Print to the screen the following header and beneath it a line of data that corresponds to…Your program will prompt the user for the following information: current population number of yearly births from the previous year number of yearly deaths from the previous year number of years into the future for your predictive value of the future population. You will then compute the following: birth rate death rate growth rate the predicted future population Assignment Notes: To allow the user to input the numeric data (such as current population) it is necessary to use the input function. The input function takes a string in parenthesis that prompts the user what to enter. The computer then waits until the user types a response, terminated by the user typing the Enter key. A string, as a sequence of characters, is returned to the variable on the lefthand side of the assignment statement. For example: currPopulation = input(“Enter the current US population”) The data in currPopulation is a string (because that is what the input statement does) but we need it to be a number…