Question

Answer this using cp++11

Answer this using cp++11

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

using namespace std;
class GPA{
private:
double grade;  
public:
GPA(){
grade=0;
}
GPA(double d){
grade = d;
}
void setGrade(double d){
grade=d;
}
double getGrade(){
return grade;
}
// returns letter based on grade
char getLetter(){
if(grade>=3.5)
return 'A';
if(grade>=2.5)
return 'B';
if(grade>=1.5)
return 'C';
if(grade>=1)
return 'D';
return 'F';
  
}
};
int main() {
GPA g1(2.32);
GPA g2(3.03);
cout<<g1.getGrade()<<" "<<g1.getLetter()<<endl;
cout<<g2.getGrade()<<" "<<g2.getLetter()<<endl;
  
  
}

Result... CPU Time: 8.88 sec(s), Memory: 3256 kilobyte(s) 2.32 С 3.03 B

Add a comment
Know the answer?
Add Answer to:
Answer this using cp++11
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • All values are on an "as-fed" basis wheat 12% moisture, 14.5% CP, 0.39% Lysine Soybean meal: 11% ...

    All values are on an "as-fed" basis wheat 12% moisture, 14.5% CP, 0.39% Lysine Soybean meal: 11% moisture, 47.7% CP, and 2.96% Lysine Peanut meal: 8% moisture, 45.5% CP, and 1.44% Lysine 1. Calculate CP and Lys concentrations (DM-basis) for all ingredients Note: use the as-is values reported above for the exercises below 2. Use algebraic equations to formulate a 23% CP mixture containing only wheat and soybean meal. 3. Use Pearson Square method to do the same. All values...

  • Using the expression dS=(CP/T)dT−VαdPdS=(CP/T)dT−VαdP, calculate the decrease in temperature that occurs if 1.10 moles of water...

    Using the expression dS=(CP/T)dT−VαdPdS=(CP/T)dT−VαdP, calculate the decrease in temperature that occurs if 1.10 moles of water at 298 K and 1085 bar are brought to a final pressure of 1.00 bar in a reversible adiabatic process. Assume that κT=0κT=0. Density of water is 0.998 g⋅cm−3g⋅cm−3, α=2.04×10−4K−1α=2.04×10−4K−1, CP=75.3J⋅K−1⋅mol−1CP=75.3J⋅K−1⋅mol−1.

  • 27. Heterozygous Cp cp chickens express a condition called creeper, in which the leg and wing...

    27. Heterozygous Cp cp chickens express a condition called creeper, in which the leg and wing bones are shorter than normal (cp cp). The dominant Cp allele is lethal when homozygous. Two alleles of an independently segregating gene determine white (W_) versus yellow (ww) skin color. From a mating between chickens heterozygous for both genes, what phenotypic classes will be represented among the viable progeny, and what are their expected relative frequencies? Please show using the branch diagram method.

  • Give a formal proof for the following tautology by using the CP rule. (B →C) ^...

    Give a formal proof for the following tautology by using the CP rule. (B →C) ^ A ^ B →A ^ C

  • Cp N2(g) 29.125 Cp gly 99.2 Cp O2 (g) 29.355 Cp CO2(g) 37.11 Cp H2O (l)...

    Cp N2(g) 29.125 Cp gly 99.2 Cp O2 (g) 29.355 Cp CO2(g) 37.11 Cp H2O (l) 75.291 2. Consider the combustion of glycine: 2 CH2(NH2)COOH(s) + 9/2 O2(g) → 2 N2(g) + 4CO2(g) + 5 H2O(1) a) What is AH® at 298 K and 500 K for this reaction? b) What is A.Sat 298 K and 500 K for this reaction? In both problems, assume that Acp does not change with temperature.

  • Ex. 6: (Change of phase), using Cp to calculate Enthalpy A feed stream to a evaporation...

    Ex. 6: (Change of phase), using Cp to calculate Enthalpy A feed stream to a evaporation unit contains an equi-molar mixture of benzene and toluene at 10°C The vapour stream from the top of the evapoator contains 68.4 mol% benzene at 50 °C and the liquid stream from the bottom contains 40 mol% benzene at 50°C. Note: You need Cp (benzene, liquid), Cp (toluene, liquid), Cp (benzene vapour), Cp (toluene vapour), latent heat of vaporisation benzene, latent heat of vaporisation...

  • CP 11–4 A tract of land valued at $50,000 has been given to a corporation on...

    CP 11–4 A tract of land valued at $50,000 has been given to a corporation on July 31, 2019 in exchange for 1,000 shares of no‐par value preferred stock. Required: 1. Prepare the journal entry to record the transaction. 2. Where would the transaction be classified in the balance sheet?

  • Ex. 6: (Change of phase), using Cp to calculate Enthalpy A feed stream to a evaporation unit contains an equi-molar...

    Ex. 6: (Change of phase), using Cp to calculate Enthalpy A feed stream to a evaporation unit contains an equi-molar mixture of benzene and toluene at 10°C The vapour stream from the top of the evapoator contains 68.4 mol% benzene at 50 °C and the liquid stream from the bottom contains 40 mol% benzene at 50°C. Note: You need Cp (benzene, liquid), Cp (toluene, liquid), Cp (benzene vapour), Cp (toluene vapour), latent heat of vaporisation benzene, latent heat of vaporisation...

  • Saved Connect Problem CP 7-11 (algo) Fill in the missing values in the table below. Instructions:...

    Saved Connect Problem CP 7-11 (algo) Fill in the missing values in the table below. Instructions: Round your answers to 1 decimal place. Nominal Gross Real Gross Year Domestic Product Domestic Product Price Index S billions) 15214.4 ($ billions) (Year 0 100) 101.7 15270.6 15604.7 15862.2 16232.2 103.8 16405.3 107.4 5 17643.1 18286.6 6 110.5 < Prev 16 of 23

  • use steam tables from perrys Problem 3 Using the steam tables: a) Calculate Cp for superheated...

    use steam tables from perrys Problem 3 Using the steam tables: a) Calculate Cp for superheated steam at 200 bar and 450 C. Compare this value to Cp for superheated steam at 450 C and lower pressures. At what point does the assumption Cp Cpis become valid, so that the assumption (H2-HI) = Cpis(T2-TI) is ok to use (assume 5% error is acceptable)? b) Use your best estimate of Cpis for 450 C to estimate H for superheated steam at...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT