100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
problem solving $6.69   Add to cart

Exam (elaborations)

problem solving

 14 views  0 purchase
  • Course
  • Computer science
  • Institution
  • Sophomore / 10th Grade

Identify the loop structures, conditional statements, and functions. Study the flow of the pseudocode, and identify the logical connections between the different sections. (solved problem)

Preview 1 out of 3  pages

  • September 27, 2024
  • 3
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
  • Sophomore / 10th grade
  • Computer science
  • 1
avatar-seller
ayonsaha
14

11 A one-dimensional (1D) array Days[] contains the names of the days of the week. A
two-dimensional (2D) array Readings[] is used to store 24 temperature readings, taken once
an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the
average temperature for each day of the week.

The position of any day’s data is the same in all three arrays. For example, if Wednesday is
in index 4 of Days[], Wednesday’s temperature readings are in index 4 of Readings[] and
Wednesday’s average temperature is in index 4 of AverageTemp[]
Ye mktg dp
The temperature readings are in Celsius to one decimal place. Temperatures can only be from ↑
–20.0 °C to +50.0 °C inclusive.
ROUND (data, 1
)
Write a program that meets the following requirements:


input and validate the hourly temperatures for one week
calculate and store the average temperature for each day of the week

• calculate the average temperature for the whole week
• convert all the average temperatures from Celsius to Fahrenheit by using the formula ✓
Fahrenheit = Celsius * + 32
• output the average temperature in Celsius and in Fahrenheit for each day
• output the overall average temperature in Celsius and in Fahrenheit for the whole week.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.

All inputs and outputs must contain suitable messages.

All data output must be rounded to one decimal place.

You will need to initialise and populate the array Days[] at the start of the program.


/ initial population of array called Days []
..........................................................................................................................................................

Days [1] "Sunday"
..........................................................................................................................................................

Days [2] "Monday"
..........................................................................................................................................................

Days [3] "Tuesday"
..........................................................................................................................................................
WeekDay Temp
Days [4] "Wednesday"
..........................................................................................................................................................
1 2 3 4
Days [5] "Thursday"
..........................................................................................................................................................
1 sundau
Days [6] "Friday"
..........................................................................................................................................................
Munday
Days [7] "Saturday"
..........................................................................................................................................................
week


..........................................................................................................................................................

..........................................................................................................................................................
saturday
..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 0478/21/M/J/23

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ayonsaha. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $6.69. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79223 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$6.69
  • (0)
  Add to cart