1)Write a statement that will create an object capable of holding the address of a float object?
2) Write a statement that will create a structure capable of holding 20 names each with a maximum of 40 characters?
3) Write a series of statements that will display on the screen the string in the...
This is what i have so far and i know that the variance part is wrong.
#include <iostream>
#include <cmath>
using namespace std;
int main ( )
{
int x[20]={0};
int count, n=0;
float sum=0, mean=0;
double variance=0, StandardDeviation;
cout << "I will give you...
Write program to display sum,mean,variance, and std deviation of an unknown number of numbers that does not exceed 20.
(The output should look like this:)
I will give you the sum, mean, and std dev of any series of numbers.
How many numbers will you enter (up to 20)? 7
Type each number...
#include <iostream>
using namespace std;
void main()
{
int n, count; //declaration
double sum=0, average;
int x[10]; //declare array’s elements as type int
cout << "How many numbers do you want to enter not exceeding 10? ";
cin >> n; //accept integer
for (count=0...
The program sort of works now but I found that there is still one more problem. The problem is that I would like to restrict them from entering more than 10 numbers. But when i executed the program and typed in 11 numbers to enter it accepted it. I was wondering is there a way to make it so...
#include <iostream>
using namespace std;
void main()
{
int n, count;
double sum=0, average;
int x[10];
cout << "How many numbers do you want to enter not exceeding 10? ";
cin >> n;
for (count=0; count<=n-1; count++)
{
cout << "Number that you entered is: " ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.