Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write an algorithm using pseudocode which takes temperatures input over a 100 day period (once per day) and output the number of days when the temperature was below 20C and the number of days when the temperature was 20C or above.

(NOTE: since the number of inputs is known, a for ... to loop can be used. However, a while loop or a repeat loop would work just as well).

total1 = 0: total2 = 0

for days = 1 to100

input temperature

if temperature < 20 then total1 = total1 + 1

else total2 = total2 + 1

endif

next

print total1, total2

This is a good illustration of an algorithm which could be written using the case construct instead of if ... then ... else. The following section of code replaces the statements if temperature < 20 then ...... endif:

case temperature of

1: total1 = total1 + 1

2: total2 = total2 + 1

Endcase

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9582100

Have any Question?


Related Questions in Computer Engineering

Why does the marginal cost curve always intersects the

Why does the marginal cost curve always intersects the average total cost curve and AVC?

Assume that the group has a portfolio of 6 stocks there is

Assume that the group has a portfolio of 6 stocks. There is 30% chance that any one of these stocks will increase in value. Find the probability that four of the six stocks increases in value.

Question subject digital securitybriefly explain how

Question : Subject: Digital security Briefly explain how Android 3.0 and later versions encrypt file and user data, and how encryption keys are derived. The response must be typed, single spaced, must be in times new rom ...

Question part 1 conflict within teamsthink of a conflict

Question: Part 1: Conflict within Teams Think of a conflict that occurred in a team you were a part of and analyze it. What were the main sources of the conflict? What interventions can be used to improve the quality of ...

Describe a ping of death attack as an attack that causes

Describe a ping of death attack as an attack that causes the victim computer to freeze and malfunction.

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

Select three interfaces and consider how the teamwork

select three interfaces, and consider how the teamwork application could be redesigned for each of these types. Use your imagination. How about using a tangible interface or even a drone to help remote students collabora ...

Think about a good or service for which you believe there

Think about a good or service for which you believe there has been a shift in demand or supply. Explain the reasons behind the shift and how that has influenced the equilibrium price.

A courier service advertises that its average delivery time

A courier Service advertises that it's average delivery time is less than six hours for a local deliveries. The random sample of times for 12 deliveries twin I'm just across town. The sample has a mean delivery time of 5 ...

A street vendor is asking people to play a simple game you

A street vendor is asking people to play a simple game. You roll a pair of dice. If the sum on the dice is 10 or higher, you win $10. If you roll a pair of 1's, you win $59. Otherwise you lose $5. If the random variable ...

  • 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