Layuut Reterences Mailings Review View Ad Font Paragraph Fall 2017 Problem 1.0 P
ID: 3869867 • Letter: L
Question
Layuut Reterences Mailings Review View Ad Font Paragraph Fall 2017 Problem 1.0 Plot the following function in computer programming language of your choice: Function Name Constant logN Logarithmic log N Log-squared Linear N logN N2 Quadratic Cubic Exponential 2N Problem 2.0 This problem is about the analysis and modelling of a problem in a computer progra Write a computer program to model a power distribution in series circuit network. K input and output parameters. Problem 3.0o Wite a Crs program to implement the following mathematical function. Make sure t going to execute for ico Problem 4.0 Write a C+t program to implement the factorial function. Problem 5.0 Order the following functions by growth rate. N. YR, Nis, Ni. Nlog N. N log log N. N log2 N, N logo 2), 2/X2N. 2N/1.37 M 2 log N. N, r dicate which functions grow at the satne rateExplanation / Answer
/* part1: 1.0 c++ program for display the Function parameters*/
#include<iostream>
using namespace std;
int main()
{
string function[12]={"C","logN","log^2N","N","N^4","N^3","2^N"};
string Name[12]={"constant","Logorithmic","Log_squared","Linear","Quadratic","Cube","Exponential"};
cout<<"------------------------"<<endl;
cout<<"function Name"<<endl;
cout<<"------------------------"<<endl;
for(int i=0;i<7;i++)
{
cout<<function[i]<<" "<<Name[i]<<endl;
}
}
/*part2: part 2.0 c++ program to model a power distribution in series circuit network */
#include<iostream>
using namespace std;
int main()
{
int consumer_numer, power;
float amount;
cout<<"Enter the customer number: "<<endl;
cin>>consumer_numer;
cout<<"Read the power consumed: "<<endl;
cin>>power;
if(power>=0 && power<=200)
amount=power*0.50;
else if(power>200 && power<400)
amount = 100+((power-200) * 0.65);
else if(power>400 && power<=600)
amount = 230 + ((power-400) * 0.80);
cout<<"Amount to be paid by customer no."<<consumer_numer<<" is Rs."<<amount;
return 0;
}
/*part3: 3.0 c++ program for implement the mathematical problem*/
#include<iostream>
using namespace std;
int main()
{
int size;
cout<<"Enter the Limit/size:"<<endl;
cin>>size;
for(int i=0;i<size;i++) //Check The condition i<0 if size is zero will not ex cute
{
i=i+3; //i cube
}
cout<<"The value i is<<i<<endl;
return 0;
}
/* part4: 4.0 c++ program to implement the factorial function*/
#include<iostream>
using namespace std;
int main()
{
long number,fact=1;
cout<<"enter Any Number:"<<endl;
cin>>number;
for(int i=1;i<=number;i++)
{
fact=fact*i;
}
cout<<"The Factorial of "<<number<<" is:"<<fact<<endl;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.