Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

I have assignments in Programming C++

1 answer below »
I have assignments in Programming C++
Answered Same Day Apr 09, 2021

Solution

Aditi answered on Apr 17 2021
153 Votes
Solution/Intermediate23.cpp
Solution/Intermediate23.cpp
#includeusing namespace std;
int main(){
    
    int temperatures[7][2];
    cout
"Enter highest and lowest temperatures:"
endl;
    
    for(int i=0; i<7; i++){
        cout
"Day "
(i+1)
": ";
        for(int j=0; j<2; j++){
            cin
temperatures[i][j];
        }
    }
    double avgHigh = 0, avgLow = 0;
    for(int i=0; i<7; i++){
        avgHigh += temperatures[i][0];
        avgLow += temperatures[i][1];
    }
    avgHigh /= 7;
    avgLow /= 7;
    cout
"Average High Temperature: "
avgHigh
"."
endl;
    cout
"Average Low Temperature: "
avgLow
"."
endl;
    return 0;
}
Solution/Introductory11.cpp
Solution/Introductory11.cpp
#includeusing namespace std;
int main(){
    
    double beginningBalance = 0.0;
    double deposits = 0.0;
    double withdrawals = 0.0;
    double balance = 0.0;
    cout
"Enter beginning balance: ";
    cin
eginningBalance;
    cout
"Enter total deposits: ";
    cin
deposits;
    cout
"Enter withdrawal: ";
    cin
withdrawals;
    
    balance = beginningBalance + deposits - withdrawals;
    cout
"Balance: $"
alance
endl;
    
    return 0;
}
Solution/Introductory14.cpp
Solution/Introductory14.cpp
#includeusing namespace std;
int main(){
    
    int small = 0;
    int medium = 0;
    int large = 0;
    int family = 0;
    int totalPizza = 0;
    double perSmall = 0.0;
    double perMedium = 0.0;
    double perLarge = 0.0;
    double perFamily = 0.0;
    
    cout
"Enter total small pizza: ";
    cin
small;
    cout
" Enter total medium pizza: ";
    cin
medium;
    cout
" Enter total large pizza: ";
    cin
large;
    cout
"Enter total family pizza: ";
    cin
family;
    totalPizza = small + medium + large + family;
    perSmall = small/totalPizza * 100;
    perMedium = medium/totalPizza * 100;
    perLarge = large/totalPizza * 100;
    perFamily = family/totalPizza * 100;
    cout
"Total pizza sold:"
totalPizza;
    cout
"Small pizza percentage: "
perSmall;
    cout
"Medium pizza percentage: "
perMedium;
    cout
"Large pizza percentage: "
perLarge;
    cout
"Family pizza percentage: "
perFamily;
    
    return 0;
}
Solution/Lab11-2.cpp
Solution/Lab11-2.cpp
#includeusing namespace std;
double getAverage(double times[], int numElements);
double getLowest(double times[], int numElements);
int main(){
    
    double finishTimes[5] = {0.0};
    
    
    double avgTime = 0.0;
    double lowestTime = 0.0;
    
    for(int x=0; x<5; x+=1){
        cout
"Time for race "
x+1
": ";
        cin
finishTimes[x];
    }   
end fo
    
    avgTime = getAverage(finishTimes, 5);
    lowestTime = getLowest(finishTimes, 5);
    
    cout
"Average 5K f...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here