1. Write a program that reads in a length in feet and inches and outputs the equivalent length in meters and centimeters. Use at least one programmer defined function for the conversion. Includ a loop that lets the user repeat this computation for new input values until the user says he or she wishes to end the program. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches in a foot.
Q: Write c++ a function multiple that determines for a pair of integers whether the second integer is a…
A: We have to write a C++ function that follows rules mentioned below, The function should help to find…
Q: Write a program that will read in a length in feet and inches and output the equivalent length in…
A: Given:- Write a program that will read in a length in feet and inches and output the equivalent…
Q: One lap around a standard high-school running track is exactly 0.25 miles. Write a program that…
A: Programming instruction: Declaring variable. Take input from the user. Call the function which…
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: Given the following function definition evoid calc(int a, int& b){ int c; C = a + 5; a = a * 2; b…
A: Answer to the above question is in step2.
Q: c++. Write a function that computes the average and standard deviation of four scores. The standard…
A: Functions for calculating the average and standard deviation are being forward declared. Declare and…
Q: Q2: Write a program that input 2 values as a number 'n' and power 'p'. both values must pass to a…
A: Here I have first of all created a function named Power that takes two input as parameters and…
Q: Write a program that requests a weight number l function that converts the weight to pounds (lb) and…
A: GIVEN: Create a C++ program that converts weight from ounces to pounds and grams.
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: b) Write a complete C- Program for Student Grade Computation. Program will use two user defined…
A: Step 1:- Program Approach:- 1.Include header file 2.Create two user-defined function whose name…
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: "Write a program that computes the amount of calories burned when you run. Your program should ask…
A: Answer: Here not a talk about any particular programming language so we will do in C++ programming…
Q: Write a C++ program to output the payment schedule for amount owed when each month nothing more is…
A: Actually, program is a executable software that runs on a computer.
Q: C++ Write a function that takes as input a positive integer n and returns the n-th harmonic number.…
A: Given: C++ Write a function that takes as input a positive integer n and returns the n-th harmonic…
Q: Given an non-negative number taken input from user, create a function which takes this integer as…
A: Write a function in C++ which takes an integer as input and returns if that number is multiple of 13…
Q: 8. Write a function which calculates the following expression for a given number of terms (N) and x,…
A: Expressions are evaluated by using loop statements and built-in functions such as pow(). And also…
Q: 2. Vrite a function int number_of_divisibles (int a, int b, int* c) where *c will store the first…
A: Here is the c code: See below steps for code.
Q: You are hired by a software company to write a C++ console which will work as a simple calculator.…
A: A C++ program is as follows, File name: “main.cpp” # include <iostream> using namespace std;…
Q: Write a function that takes one argument, an integer, and returns the value of the following…
A: For First Part- Code is- #include <iostream>#include<cmath>using namespace std; int…
Q: In Python, write a program that contains main and another custom function that generates a specified…
A: Given: In Python, write a program that contains main and another custom function that generates a…
Q: Write a function that simulates a guessing game as follows. The computer will generate a random…
A: Note: Follow proper indentation Comments mentioned in code for understandability Code: import…
Q: Write a function that prompts the user for the base and the height of a triangle and then proceeds…
A: To find area of the triangle, in python with length of height and base given, we need to first take…
Q: Q2/Write a program that reads from the user the value of x and apply the function below: * x+4 x-3+…
A: Code in c++ as you have not mentioned the coding language providing the code in c++: #include…
Q: Q2/Write a program that reads from the user the value of x and apply the function below: 1 11.5 > x…
A: C++ program for above : #include <bits/stdc++.h> using namespace std; //function to…
Q: Write a program that reads in a length in feet and inches and outputs the equivalent length in…
A: The Cpp program is written where it covers all the three exercises. The conversion of two programs…
Q: Write a function that calculates: a = V(X + Y – 2) * 10
A: Matlab code to find the solution for the above expression using function: Imaginary values for x, y…
Q: Write the function to print whether number can be divided by 3 on the screen. Print "Can be…
A: Below is the required code in C language. Program Approach: Including necessary header files for…
Q: Question 1: Write a program using functions, which can print a rectangle of stars (Asterisks) of…
A: Define the function rectangle to hold the height and width. In main function take the value from the…
Q: In this question you need to write a program and execute it with the given input, the output of your…
A: python program to check Islamic year: def checkLeap(year): return ((11*year + 14)%30) <…
Q: (a) Write a function num_bad_days(daily_water_intake) that takes a list of daily water intakes and…
A: logic:- a) set a count=0 iterate for each reading in i check if i>50 increment count end…
Q: 6. Write a function called convertTime, which accepts the number of seconds (integer) seconds and…
A: Given: By using the C++ programming language, please provide the source code, screenshot of the…
Q: Write a function called print_multiples that takes in a number and prints out 10 multiples of that…
A: Required: to create a function that can print 10 multiples of a given number. Required code with…
Q: Question 3: Write a program which reads in a starting day (Mon, Tue, Wed) and a time value in the…
A: from datetime import time,timedelta def main(): print("Enter a time in HHMM format:")…
Q: In this question you need to write a program and execute it with the given input, the output of your…
A: Islamic year for the Gregorian year 1946 is 1364.
Q: Write a program that prompts the user to input a sequence of characters and outputs the number of…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: Write a function averageDigits that computes the average of the digits of a 3-digit positive number…
A: The function averageDigits() takes an integer parameter and returns the average of all digits that…
Q: 3. Write a function which will take 3 arguments minimum, maximum and divisor. You have to find all…
A: the answer is given below:-
Q: In this question you need to write a program and execute it with the given input, the output of your…
A:
Q: Consider the function definition below. Assume x = 5, y = 3 and j = 8 as the function starts. Which…
A: The above question is solved in step 2 :-
Q: Q2/Write a program that reads from the user the value of x and apply the function below: * x+4 12 >…
A: For these questions we have to first extract the code flow and then accordingly make a C++ code for…
Q: Write a function receive 3 numbers and return the summation of them. *
A:
Q: Create a function that accepts up to two inputs. If the user enters two inputs, it returns the sum…
A: Algorithm: 1. Start 2. Create a function addSqrt 3. Using nargin find the no.of arguments passed.…
Q: Q2/Write a program that reads from the user the value of x and apply the function below: 11.5 > x >…
A: As you have not mentioned the language i am providing the code in c++: #include…
Q: C++ write a program that inputs 10 integers from the user and passes them one at a time to the…
A: Program approach:- Header files. Function to check whether the number is odd or even. When a number…
Q: Write a program that reads in two numbers and stores them into two variables a and b respectively.…
A: Program approach: Create input function to input values. Create processing function to swap the…
Write the following in C++.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Use C++ Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. Positions 0-4 of coinVals should contain the number of dollars, quarters, dimes, nickels, and pennies, respectively.void ExactChange(int userTotal, vector<int>& coinVals)2. Write a program that generates a number randomly by using rand ( ) function and user will have to guess that number. (Note: If the number is greater or smaller than user-entered number, your program should tell that the entered number is greater or smaller than computer-generated number and your program should terminate after correct number is guessed). sample program run is shown in the picture.Write a function feet to meters() that changes the values of meter and cm based on the user inputs feet and inches, where meters, cm, feet, and inches are all variables. Embed this function in a loop so the user can keep inputting feet and inches and the program calls feet to meters() to give updated meters and cm.
- Display the first N magic numbers, where N is a positive number that the user provides as input. Here, a magic number is a number whose sum of its digits eventually leads to 1. For example, 1234 is a magic number because 1 + 2 + 3 + 4 = 10 and 1 + 0 = 1, while 1235 is not (1 + 2 + 3 + 5 = 11 and 1 + 1 = 2). Write a program that prints out the first N magic numbers, seven on each line. You are required to use the following function prototype: bool isMagic(int value); // Returns true if value is a magic number The outline of this function will be as follows: Step 1: Calculate the sum of digits of the value Step 2: Repeat Step 1 until we get a single-digit Step 3: If the resulting sum is equal to 1 then it is a magic number, otherwise not Here is the sample output:C++ Write a function that takes as input a positive integer n and returns the n-th harmonic number.Reminder: the n-th harmonic number is equal to 1+(1/2)+(1/3)+(1/4)+...+(1/n)Write a function that displays all the numbers between two integers in n lines, that are divisible by 5 or 7 (not by both). So, the function should take as parameters the minimum and maximum of integer numbers and n. If no values are passed to them, this function should display the numbers between 1 and 100 in 10 lines. Write a test program to test your function. *Output of the numbers should be formatted well.
- Programming Practice a) Write a program which allows a teacher to determine the min, max, and average grade from grades entered. The teacher will continuously enter grades until the sentinel is specified. For this example, a grade of -1 will be used to denote grading is completed. The min, max, and average grade should then be displayed to the teacher. This program should not accept invalid grades to be used [0, 100]. b) Write a program which outputs prime numbers up to a specified number. For example, if a user entered the number 25, the program would output the prime numbers between 1 and 25. c) Write a program which converts a sum of currency into the highest available denominations in terms of coins. For example, the user inputs the number 4.25. The program would output that it takes 2 Toonies and 1 Quarter. Ensure that the result uses the least amount of coins possible. This can be solved mathematically or using loops.Write a function that displays all the numbers between two integers in n lines, that are divisible by 5 or 7 (not by both). So, the function should take as parameters the minimum and maximum of integer numbers and n. If no values are passed to them, this function should display the numbers between 1 and 100 in 10 lines. Write a test program to test your function. *Output of the numbers should be formatted well I want in C++in the following program please use string data types and string functions. use enum types. for loops with enum types, etc. Thank you. Write a C++ program that takes a date in the following format: December 24th, 2021 and extracts the day, month, and year as 3 integers. Your program should have and use at least the following functions: (a) Write a function getDate that prompts a user to enter a date as a string and returns it. (b) Write a function extract that takes as its parameter a date and returns the day, month, and year as 3 integers. (Hint: you can use the function isdigit(c) that returns true if c is a digit character and false otherwise.) (c) Write a function convertDigits that takes as its parameter a string of digits and converts it to an int. (Hint: to convert a digit character to a digit number use static cast (’d’) - static cast(’0’) where d is 0, 1, ..., 9) (d) Write a function convertMonths that takes as its parameter a month as a string and returns a corresponding…
- Question 6 Write a function that takes four integers f1, f2, g1, g2, defining two closed intervals [f1,f2] and [g1,g2] of the real number line, and returns True if these two closed intervals overlap and False otherwise. Sample input: f1 = 100, f2 = 250, g1 = 61, g2 = 150 Expected output: True Full explain this question very fast solution sent me step by step Don't ignore any partWrite a function that asks the user how many Fibonacci numbers to generate and then generates them. Make sure to ask the user to enter the number of numbers in the sequence to generate. The Fibonacci sequence is a sequence of numbers where the next number in the sequence is the sum of the previous two numbers in the sequence. The sequence looks like this: 1, 1, 2, 3, 5, 8, 13, § You could assign your input integer to a variable num by num = int(input("How many fib. numbers you want to generate?:")). § You have to consider exceptions, such as the input integer is zero, negative numbers or floats. § Please submit your code and console screenshots to Blackboard. Code containing syntax error will be graded zero. § Example: The prompt asks, “How many fib. numbers you want to generate?PROBLEM: Write a program that prompts the user to input coefficients A, B, and C of a quadratic equation in general form (Ax^2 + Bx + C = 0) to determine the nature of the roots of the quadratic equation. SPECIFICATIONS: - You may only use the codes that we studied under our lectures - All lines of codes should have a comment. - Save your cpp file as Surname - PE (Example: Pangaliman - PE.cpp) TEST CASES: If a user inputs the three coefficients of a quadratic equation: Enter A: 1 Enter B: 7 Enter C: 12 Result: The roots are real and distinct. If a user inputs the three coefficients of a quadratic equation: Enter A: 2 Enter B: 2 Enter C: 3 Result: The roots are complex and distinct.