Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

problem solving

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
27-09-2024
Written in
2024/2025

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)

Institution
Sophomore / 10th Grade
Course
Computer science

Content preview

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

Connected book

Written for

Institution
Sophomore / 10th grade
Course
Computer science
School year
1

Document information

Uploaded on
September 27, 2024
Number of pages
3
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$7.19
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
ayonsaha

Get to know the seller

Seller avatar
ayonsaha
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
5
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions