Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Programming in C++

Loops and DecisionsPart A

Explain the difference between:

s = 0;

If (x > 0) s++;

If (y > 0) s++;

and

s = 0;

if (x > 0) s++;

else if (y > 0) s++;

Part B

What are the values of s and n after the following loops?:

a. int s = 1;

    int n = 1;

    while (x < 10) 

    s = s + n;

    n++;

b. int s = 1;

    int n;

    for (n = 1; n < 5; n++)

        s = s + n;

c. int s = 1;

    int n = 1;

    do

    {

        s = s + n;

        n++;

    }

    while (s < 10 * n);

Part C

Write a program that accepts four grades, calculates the average of the four grades, and then converts the average from a number grade into a letter grading using the following grading scale: 

A  100 - 90

B   89 - 80

C   79 - 70

D   69 - 60

F   59 - 0

Output the final grade average along with the letter grade.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91401223
  • Price:- $20

Guranteed 24 Hours Delivery, In Price:- $20

Have any Question?


Related Questions in Computer Engineering

In defining demand and supply why do economists focus on

In defining demand and supply, why do economists focus on price while holding constant other factors that might have an impact on the behavior of buyers and sellers?

Answer the following question research management in a

Answer the following Question : Research management in a field and compare it with the field in software. Compare the management techniques with that field you chose to software project management. The response must be t ...

You are saving up to buy a toyota tundra which costs 35000

You are saving up to buy a Toyota Tundra, which costs $35000 now. You don't think the price of the Toyota will change over the next two years. You don't want to borrow to pay any of this cost. You now have $10000 toward ...

Candidate as pollster conducted a survey in which 450 out

Candidate A's pollster conducted a survey in which 450 out of 710 respondents indicated they would probably vote for Candidate A. Compute the confidence interval for the population.

A chemistry student needsnbsp700 ml of dimethyl sulfoxide

A chemistry student needs 70.0 mL of dimethyl sulfoxide for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of dimethyl sulfoxide is 1.10 g.cm^-3. Calculat ...

Say you want to match ip addresses however its likely that

Say you want to match IP addresses. However, it's likely that an invalid IP address such as 192.168.1.256 will match with your regex as well. What would you would need to do to validate that an IP address is valid, and w ...

Write a java console application that calculates and

Write a java console application that calculates and displays the bank interest for N bank accounts. N should be declared as a constant and it should be equal to the largest digit of your student ID number (e.g. if your ...

What are the uses and value of statistical significance

What are the uses and value of statistical significance testing and the p-value as demonstrated in the various analytical techniques (t-tests, ANOVA, chi-square, etc.). What's the fundamental reason we apply these techni ...

Compare remote authentication dial-in user service radius

Compare Remote Authentication Dial-In User Service (RADIUS) and Terminal Access Controller Access-Control System Plus (TACACS+).

1 under what circumstances is it advantageous for a company

1. Under what circumstances is it advantageous for a company competing in foreign markets to concentrate its value chain activities in a select few locations? Under what circumstances is it advantageous for a company com ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As