Answer:
encrypted
Explanation:
to prevent others from viewing it
I've never heard of a group account so I'm going with.
C. Group
The enter key sends the cursor to the next line, or it executes a command or operation.
Answer:
#include <iostream>
#include<time.h>
using namespace std;
class Student
{
public :
int grades[20]; //array of grades
double average(int arr[],int n) //method to calculate average of array of grades passed
{
int sum=0;
for(int i=0;i<n;i++) //loop to calculate sum of all grades
sum=sum+arr[i];
return sum/n; //average is sum of items/number of items
}
int get_grade() //method to return grade number(1-14)
{
srand(time(NULL)); //method to generate different random number each time
int num = rand() % 14 + 1; //method to generate random number b/w 1-14
return num;
}
};
int main()
{
Student s;
int grade[]={5,3,9,8,10};
cout<<"Average is : "<<s.average(grade,5);
return 0;
}
OUTPUT :
Average is : 7
Explanation:
A class Student is created in which a method named average is there to calculate average of the grades passed and a method to generate a grade number b/w 1-14.
Answer:
#include <iostream>
#include<iomanip>
using namespace std;
double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)
{
double dollarCost = 0;
dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;
return dollarCost;
}
int main()
{
double miles = 0;
double dollars = 0;
cout << "Enter miles per Gallon : ";
cin >> miles;
cout << "Enter dollars per Gallon: ";
cin >> dollars;
cout << fixed << setprecision(2);
cout << endl;
cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;
cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;
cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;
return 0;
}
Explanation:
- Create a method definition of DrivingCost that accepts three input double data type parameters drivenMiles, milesPerGallon, and dollarsPerGallon and returns the dollar cost to drive those miles
.
- Calculate total dollar cost and store in the variable, dollarCost
.
- Prompt and read the miles and dollars per gallon as input from the user
.
- Call the DrivingCost function three times for the output to the gas cost for 10 miles, 50 miles, and 400 miles.