Answered! Use cloud 9 or X code if you are on Mac to create the following three function sets. Submit to GIT when complete…

1080C/CS1: C++ Programming n class 4 -Spring 2017 Use cloud 9 or Xcode if you are on Mac to create the following three function sets. submit to GIT when complete Function 1 write a function that Sums all the ASCII values in a c string It takes a C++ string as parameter and returns an unsigned value. Please pick a reasonable name and write a short main function to test it Note You can use a C++ string as an array Function 2 Pick a 3D Shape and write two functions one to calculate the volume and one to calculate the surface area of that shape. write the necessary main to test to these functions Function 3: Wind chill in Celsius can be calculated using the following formula W 33 (10 sqrt(v) v 10.5) (33 t 23.1 Where: v is wind speed in meters/second t is air temperature in degrees Celsius: Wis wind chill index (in degrees Celsius) The above equation only valid for an actual air temperature 10 C Write a function of type bool that returns true if the wind chill (W is less than zero, otherwise it returns false. The wind chill value for the given temperature and wind speed is given back to the calling function via a reference variable passed in as a parameter to the wind chill function. If the value of temperature is out of the range of the calculation (t 10 C), the wind chill value (W) is the original temperature value Please provide the necessary main to test this function. 1080C/CS1 C++ Programming In class 4 Spring 2017

Use cloud 9 or X code if you are on Mac to create the following three function sets. Submit to GIT when complete. Write a function that Sums all the ASCII values in a C++ string it takes a C++ string as parameter and returns an unsigned value. Please pick a reasonable name and write a short main() function to test it. Pick a 3D Shape and write two functions one to calculate the volume and one to calculate the surface area of that shape. Write the necessary main() to test to these functions. Wind chill in Celsius can be calculated using the following formula: W = 33 – (10 squareroot (v) – v + 10.5)(33 -1)/23.1 Where: v is wind speed in meters/second t is air temperature in degrees Celsius: W is wind chill index (in degrees Celsius) The above equation only valid for an actual air temperature

Expert Answer

 1.Program:

#include <iostream>
#include <string>
using namespace std;

class Ascii
{
public:
void SumOfAscii()
{
int sum = 0, i, len=0;
char string1[100];

cout<<“Enter the string : “;
cin>>string1;
for(i=0;string1[i]!=’’;i++)
{
len++;
}
//len = strlen(string1);
for (i = 0; i < len; i++)
{
sum = sum + string1[i];
}
cout<<“Sum Of ASCII Character is “<<sum;
}
};
int main()
{
Ascii obj;
obj.SumOfAscii();

return 0;
}

Output:

Enter the string : Ram

Sum Of ASCII Character is 288

Problem2:

// Example program
#include <iostream>
#include <string>
using namespace std;

class Shape
{
public:
void CalculateVolume(double a)
{
cout<<“Volume of a cube ” <<(a*a*a);
}
void SurfaceArea(double a)
{
cout<<“nSurface Area of a cube ” <<(6*a*a);
}
};
int main()
{
Shape obj;
double a;
cout<<“Enter Edge of a cuben”;
cin>>a;
obj.CalculateVolume(a);
obj.SurfaceArea(a);

return 0;
}

Output:

Enter Edge of a cube

5

Volume of a cube 125

Surface Area of a Cube 150

3. Program:

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
bool CaluculateWindChill(int &v,int &t);
class WindChill
{
public:
bool CaluculateWindChill(int &v,int &t)
{
bool val=false;
double W;
if(t>=10)
{
W=t;
cout<<“nWind Chill Is “<<W;
}
else
{
W=(33-(10*sqrt(v)-v+10.5)*(33-t))/23.1;
cout<<“nWind Chill Is “<<W;
}

if(W<0)
{
val=true;
}
return val;
}

};
int main()
{
WindChill obj;
int a,b;
cout<<“Enter wind speedn”;
cin>>a;
cout<<“Enter temperaturen”;
cin>>b;

bool val=obj.CaluculateWindChill(a,b);

return 0;
}

Output:

Enter wind speed

5

Enter temperature

11

Wind Chill Is 11 ​

Still stressed from student homework?
Get quality assistance from academic writers!