in C++ answer question
Create a function named Poland that returns 10 times whatever the input was. Call this function from main in a for loop 25 times, pass in "i" each time.
#include<iostream>
#include<string>
using namespace std;
string Poland(int i)
{
string output="";
for(int j=1;j<=10;j++)
{
output=output+i+" ";
}
return output;
}
int main()
{
int i;
for(i=1;i<=25;i++)
{
cout<<Poland(i)<<endl;
}
return 0;
}
in C++ answer question Create a function named Poland that returns 10 times whatever the input...
Please write the code using matlab
1) i. Create an anonymous function named optimist, that accepts a single variable as input i Create a row vector Tthat represents the number of seconds in two minutes, starting ii. Call the function optimist on the vector T, store the result in variable R1 and returns the double of that variable from one and ending at a hundred and twenty v. Create an anonymous function named pessimist, that accepts a single variable as...
C++ write a function named subtract that takes two integers as parameters and returns the result of subtracting the second number from the first. i.e. int1 - int2 Change subtract to have default arguments for its two parameters. Pick whatever non-zero numbers you would like. Write a prototype for subtract before main so the program runs without error. I cant figure out the part where you pass no parameters, I've tried to set defailt values for the parameters but it...
Help answer Questions in C++ 14. Create a function that swaps the values of the two inputs; it should do so as a pass by reference. 15. Create a function that returns the max of two numbers. 16. Create a function that rolls a dice named ROLL. It should create a random number between 1 and 6. Create another function that rolls two dice and says SNAKE EYES if you both rolls are a 1. Call these functions until you...
using C++ for beginners Create a function named Bear that takes in a double and returns the integer part (e.g. if it takes in 2.15 it returns 2)
Create and call a function Using the Visual Basic Editor: create a VBA procedure named call_function that does the following: Prompts the user, using two input boxes, for the height and the radius of the base of a cone. Calls a function named cone_volume and passes the two values to it. Receives a value back from the function and displays it in a message to the user. Create a function named cone_volume that does the following: Receives the two values...
Create a function that takes a list and an integer v, and returns True if v is in the list (False otherwise). The function should be efficient and stop searching as soon as possible. •The main program must generate a very large list with random elements, call the function to search a value and display the result. Add in the function a variable Nsteps to count the number of steps used by the algorithm (number of times the loop is...
C and C++ Console Application for Student Data 1- Write a function named Average that a. Receives two integer numbers as parameter and returns the average b. Is used in a main function. Main() stays in a loop and asks user to enter 2 numbers and then shows the average using the Average function above 2- Define a class named Student with following members: a. private data: 2 grades and a GPA (average). b. public constructor to initialize the members...
create a javascript function named bbqFood that takes in an object and returns an array. The input object will have strings naming party foods as the key and the numbers of people that each key will feed as its values. return an array containing all of the keys whose values are greater than 10, menaing it will feed more than 10 people. example bbqfood(['taco':15, 'hamburger':6,'pasta':42,'fruit':23}) must return ['taco','pasta','fruit']
Create a function named build_letter_distribution that has the same signature as build_dictionary. This function returns a dictionary; however, each key will be a letter and the value will be the count that represents how many times that letter was found. Essentially you will have a letter distribution over a sentence (which is a list of words). The letters should be case insensitive. See the lesson on "Working with Lists" on how to get the individual characters from a string Normalize...
Problem H1 (Using C++) In the main function, define four variables of type int, named: first, second, third, and total. Write a function named getData that asks the user to input three integers and stores them in the variables first, second, and third which are in the main function. Write a function named computeTotal that computes and returns the total of three integers. Write a function named printAll that prints all the values in the format shown in the following...