triangle, the sum of the lengths
Q: In Python: can you this problem be solved without using "while" and "for". Write a function called…
A: We need to write a program in python that takes the input of an integer between 1 and 50. program…
Q: Two positive integers are said to be friendly if each one is equal to the sum of the divisors…
A: Your C++ program is given below as you required with an output.
Q: This program in C++ will obtain from the user a full name, a current annual salary, and a percent…
A: The required code for the C++ program is coded using a for loop in the next step.
Q: Write a C program that will ask the user to enter the lengths of a femur bone and a humerus bone…
A: Required:
Q: Develop a program for current electrical billing system based on the given requirements using the…
A: 1. Flowchart for generating electricity bill
Q: NOTE: in mathematics, the square root of a negative number is not real; in C++ therefore, passing…
A: A C++ program is to be created that will read the value for area of square and will print the…
Q: Write a C++ program that reads in temperature in Celsius and displays temperature in Fahrenheit;…
A: Note- Your output is wrong f=(9/5)*20+32 = 68 is the correct answer and you are showing 55 which is…
Q: You have to make aC Program to Convert Celsius from Fahrenheit, Kelvin and Réaumur or to Convert…
A: As per the question statement, we will write program in c language.
Q: Using functions, write a full C++ program that reads four integer numbers entered by the user two at…
A: Answer in step2
Q: i am having problems making my program works. the following is what I have to do and underneath it…
A: Ans is given in following steps:
Q: Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2. If…
A: Required: Using functions, develop a full C++ structured program that asks the user for his choics:1…
Q: Using functions, write a C program which does the following; The user enters the height(h) and…
A: Volume of cylinder: #include <stdio.h> float cylindervol(float, float); int main(){ float…
Q: The volume of oil stored in an underground 200-foot deep cylindrical tank is determined by measuring…
A: float filled(int r,int h){ float pi=3.141; return (float)pi*r*r*(200-h);}
Q: can someone help me with this in C++ A character value (a letter from the English alphabet) A…
A: - We need to highlight the code for character match in a string.
Q: I want to solve the question in c++ please Modify your program to make the user enter a quantity…
A: #include <iostream> using namespace std;int input(){ int n; cin>>n; return n;}…
Q: Write a c++ program to compute and display a person's weekly salary as determined by the following…
A: Given:
Q: : Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine is…
A: computeDifference(int pH,int fH,int pM,int fM,boolean pA,boolear fA){ int dH,dT; boolean dA; int…
Q: Write C Program that receive number of students in a Lecture, and decide how much form of exam…
A: logic:- read number of students read width and height of lecture hall. define sizeLecture(double…
Q: Write a program in C++ , that finds solution (roots) of quadratic equation, allow user to input as…
A: Program: //Include necessary header files #include <iostream> #include <cmath>…
Q: To check whether it’s a prime number? Find its factorial? Whether it’s even or odd?
A: Actually, program is a executable software that runs on a computer.
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: CODE:- #include <iostream>using namespace std;void check(int numYears){ if (numYears >…
Q: A character value (a letter from the English alphabet) A string value (string consisting of only…
A: Below program implements a function countChar() which takes two parameter, character c and string…
Q: Write a C++ function that returns true if any of the two integer parameters passed as input is 20,…
A: Write a C++ function that returns true if any of the two integer parameters passed as input is 20,…
Q: Using functions, write a C program which does the following; • The user enters the height(h) and…
A: Here I have used the value of pi as 3.14. Algorithm : calc_vol function Step 1 : declare variable…
Q: Using functions, write a full C++ program that reads four integer numbers entered by the user two at…
A: Program to solve the Sum of the product problem: - Program: - #include <iostream>using…
Q: Write an algorithm, draw a flowchart, and write a C program that calculates a customer water bill.…
A: #Algorithm for calculating the customer water bill. STEPS:- 1)Start. 2)Define the minimum pay value.…
Q: You are asked to write a C program that will accept representing the number of dollars and cents to…
A: Program when only cents are given: #include<stdio.h>void convert(int change){int i;// required…
Q: You are asked to manage salaries of employees of an organization. Write a C++ program to store basic…
A: Create an array of size 15 to store the salaries of 15 employees Input Salary and number of leaves…
Q: 3. When will Friday the 13th occur in 1990? Write a C program that will find all months in 1990 in…
A: Your C program is given below as you required with an output.
Q: Using functions, write a full C++ program that reads four integer numbers entered by the user two at…
A: C++ Program for Above : #include <bits/stdc++.h> using namespace std; //SOP function int…
Q: ) You are required to produce a C++ program which solves the following: 1- A worker is paid…
A: Note: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: Write a C++ program that asks for the user’s name and then the program will output the last 4…
A: C++ Programming-
Q: Use C++ Write a program with total change amount as an integer input that outputs the change using…
A: A required program is as follows, #include <iostream> #include <vector> using namespace…
Q: Ali gives pocket money to his son in following fashion. Whatever pocket money is given on first day,…
A: Program approach:- Using the necessary header file. Using the namespace standard I/O. Define the…
Q: Write a c program that will use functions to covert degree Celsius in to kelvin
A:
Q: Lets f(x) = ax^2 +bx +c is a non-linear equation. Your program should be able to get input from user…
A: C++ language is an object-oriented programming language, It will also be supported by procedural,…
Q: i want the solution in C++ language solution should setup the midnight time to 0, and then write…
A: Following is the c++ program: Variables used: startHours, startMins are used to store the starting…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: PROGRAM CODE: #include <iostream> // include header file for input output streamusing…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: The code and the output has been given in step 2.
Q: 92 93 94 95 96 97 98 string course = "Math"; void valid (int a, float b) { static float k= 5.0;…
A: This is because, it takes the latest value (“Engl”) is assigned and previous value has become null.…
Q: Write a C++ program that calculates the Diagonal of a Square. The main function asks the user to…
A: Diagonal of a Square=side* square root of 2 Algorithm 1. In main take side length of square from…
Q: Write C++ program that evaluate the sum of the following series Sum= 1+ X^1 / 1! + X^2/2! + X^3/3! +…
A: C++ code: #include <iostream>#include <cmath>using namespace std; /*function to find…
Q: Write a C++ function void rect (int& ar, int& per, int len, int wid) that computes the area ar and…
A: Code for copy #include <iostream>using namespace std; void rect(int *ar, int *per, int len,…
Q: Using the starter code below, write a program that asks a user for two points (x1, y1) and (x2, y2),…
A: We will input the (x,y) pairs for the center point and the perimeter point. Then we will pass all…
Q: Write a complete C++ program to do the following: Prompt the user to enter the number of students…
A: Required: Prompt the user to enter the number of students and store it into a variable called…
Q: Write a C-program that converts metric measurements to imperial system values. Measurements are…
A: Given conversion rules to use: 1 meter = 3.2808 feet; 1 gram = 0.002205 pounds; temperature in…
Q: Write a C++ Program, using functions, that, given a number greater than zero (0), the user will…
A: Answer in step2
Q: Use C++ Write a program whose input is a character and a string, and whose output indicates the…
A: Answer: Here Step 1: taking the user inputs of type character and string Step…
Q: Using functions, write a C program which does the following; The user enters the height(h) and…
A: Given: Write a c program to find volume of a cylinder and surface area of a cylinder using function.
Q: Using functions, write a full C++ program that reads four integer numbers entered by the user two at…
A: CODE:- #include <iostream> #include<stdio.h> #include <cstdlib> using namespace…
In a triangle, the sum of the lengths of any two sides is greater than the length of the other third side. Write a c++ program that prompts a user to enter the lengths of three sides, check if they form a triangle, and outputs if it is an isosceles, equilateral, scalene, or right triangle where you have to define and use the following functions:
-
(a) isTriangle - takes 3 sides of a triangle and returns true if they form a triangle, false otherwise.
-
(b) isIsosceles-takes3sidesofatriangleandreturnstrueiftheyformanisosceles triangle, false otherwise.
-
(c) isEquilateral - takes 3 sides of a triangle and returns true if they form an equilateral triangle, false otherwise.
-
(d) isRight - takes 3 sides of a triangle and returns true if they form a right triangle, false otherwise.
You program should run repeatedly until the user wants to quit.
Step by step
Solved in 2 steps with 1 images
- NOTE: in mathematics, the square root of a negative number is not real; in C++ therefore, passing such a value to the square root function is an error. Given a double variable named areaOfSquare write the necessary code to read in a value, the area of some square, into areaOfSquare and print out the length of the side of that square. HOWEVER: if any value read in is not valid input, just print the message "INVALID".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 c++ program 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.Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2. If the choice is 1, then your program will convert the entered Fahrenheit (F°) temperature to Celsius (C°). If the choice is 2, then your program will convert the entered Celsius (C°) temperature to Fahrenheit (F°). use the following functions: - getTemp: read the temperature from the user - getChoice: read the user choice: 1 or 2 NOTE: only 1 or 2 are allowed, if not, then give an error message warning for three times, then exit the whole program with a message if the problem persists. - convertToF: converts Celsius to Fahrenheit F°= (9/5) * C° + 32 - convertToC: converts Fahrenheit to Celsius C°= (5/9) * (F° - 32)
- CODE USING C++ Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah". Let's try this out now! Input A line containing two integers separated by a space. 777·7 Output A line containing a string. Jackpot!(Practice) Write a C++ program that accepts the rectangular coordinates of two points (x1,y1)and(x2,y2), calculates the distance of each point from the origin, and calculates the distance between the two points. The distance, d, between two points is given by this formula: d=(x2x1)2+(y2y1)2Q10/ Write a program in c++ that converts Celsius to Fahrenheit according to the following equation: F = 9/5 C+32 .By using functions
- You are asked to manage salaries of employees of an organization. Write a C++ program to store basic salaries of 15 employees by reading from the user. Calculate tax on salaries and add bonuses to find the final salary that should be paid. If an employee has 0 leaves in the month than a bonus of 8% is added to his/her salary. If an employee has salary more than 1 lac, 15% tax shall be deducted, if salary is between 50,000 and 1 lac, 10% tax shall be deducted, if salary is less than 50,000 than 6% tax shall be deducted. Find final salaries of employees and store in a new array. Program shall than display list of final salaries and also maximum and minimum salaries from final salaries.In C++ please, thanks. A prime number is an integer n > 1 whose only positive divisors are 1 and n itself. Write a boolean-valued function that determines whether an integer is a prime number.Write a program in C++ that converts kilometers per hour to miles per hour.Program will accept as input the speed into km/h and will output the result intom/h
- Modify the craps program to allow wagering inside of C#, and explain each step (reject if you can't). Initialize variable Balance to 1000 dollars. Prompt the player to enter a wager. Check whether the wager is less than or equal to Balance and, if not, have the user reenter the wager until a valid wager is entered. After a valid wager is entered, run one game of craps. If the player wins, increase Balance by wager, and print the new Balance. If the player loses, decrease Balance by wager, print the new Balance, check whether Balance has become zero and, if so, print the message “Sorry. You busted!” (explain steps as much as possible so I can understand plz).The program to modify has the code listed below:// Craps class simulates the dice game craps.using System; class Craps{// create random-number generator for use in method RollDiceprivate static Random randomNumbers = new Random(); // enumeration with constants that represent the game statusprivate enum Status {Continue, Won, Lost}…Write a C++ program that calculates the Volume of a Triangular Prism. The main function asks the user to input a (i.e., length of the triangular prism), b(i.e., base length of the triangular prism), and h(i.e., the height of the triangular prism. Then the main function calls another function to calculate the volume of that triangle prism. Finally, the main function displays the volume of the triangle prism. Recall that Volume of a Triangular Prism =1/2 abhWrite a complete C program to take a depth (in kilometers) inside the earth as input data;compute and display the temperature at this depth in degrees Celsius and degrees Fahrenheit. The relevant formulas are Celsius = 10 (depth) + 20 (Celsius temperature at depth in km) Fahrenheit = 1.8 (Celsius) + 32 Write this program using two different functions - - one function "celsius_at_depth" should compute and return the Celsius temperature at a depth measured in kilometers.The second function "fahrenheit" should convert a Celsius temperature to Fahrenheit. You don't have to use pointers to pass the data to the function(s). This is just to begin to understand, in general, what a function is, why use them, how to use them. see my attached example for a very simple program with a function. ---------------------------------------------------------------------------Example----------------------------------------------------------------------------------------- #include <stdio.h> int…