A programmer for a weather website needs to display the proportion of days with freezing temperatures in a given month.


Their algorithm will operate on a list of temperatures for each day in the month. It must keep track of how many temperatures are below or equal to 32. Once it's done processing the list, it must display the ratio of freezing days over total days.
Which of these correctly expresses that algorithm in pseudocode?
A.
numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

DISPLAY(numFreezing/numDays)

}

B.
numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

}

DISPLAY(numFreezing/numDays)

C.
numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp < 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

}

DISPLAY(numFreezing/numDays)

D.
numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

numDays ← numDays + 1

}

}

DISPLAY(numFreezing/numDays)

Answers

Answer 1

Answer:

B.

Explanation:

The correct Pseudocode for this scenario would be B. This code makes two variables for the number of total days (numDays) and number of freezing days (numFreezing). Then it loops through the entire data set and checks if each temp is less than or equal to 32 degrees. If it is, it adds it to numFreezing, if it is not then it skips this step, but still adds 1 to the total number of days after each loop. Once the entire loop is done it prints out the ratio, unlike answer A which prints out the ratio for every iteration of the loop.

numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

}

DISPLAY(numFreezing/numDays)


Related Questions

Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters.
For example, the string "THIS_IS_THE_BEST_WISH" can be encoded as "%#_#_%E_BEST_W#H" by replacing all instances of "TH" with "%" and replacing all instances of "IS" with "#".
Which of the following statements about byte pair encoding is true?
A. Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string.
B. Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced by a single character.
C. Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.
D. Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages securely.

Answers

Answer:

C. Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.

Explanation:

Byte pair encoding is a form of encoding in which the most common pairs of consecutive bytes of data are replaced by a single byte which does not occur within the set of data.

For example, if we has a string ZZaaAb, it can be encoded if the pairs of string ZZ are replaced by X and the second pair by Y. So, our data now becomes XYAb.

To get our original data, that is decode it, we just replace the data with the keys X = ZZ and Y = aa thus allowing our original data to be restored.

Since our original string is restored without loss of data, it implies that byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.

5.2
Explain ONE reason why the special equipment is used when
testing eyesight for a driver's licence.
(2)​

Answers

Answer:

In order to reduce the risk of accidents on the roads.

Explanation:

The special equipment is used when  testing eyesight for a driver's license in order to reduce the risk of accidents on the roads. Good eyesight is very important for good and safe driving so to find out the eyesight of the driver, the license officer used special equipment in order to check driver's eyes. If the eyesight is good, the officer provide license to the person otherwise not so that no accidents happen on the road.

como se genera la electricidad con energias no renovables
porfa alguien me ayuda llevo muchas horas buscando la respuesta
doy corona y todos lo puntos que pueda

Answers

Answer:

efeiueur eiuube erferve

Explanation:

Answer:

La energia no renovable proviene de fuentes que se agotaran o no se repondran durante miles o incluso millones de años.

Los combustibles fósiles se queman para generar energía y electricidad. Por ejemplo, carbón.

Fill in the blanks
A dash is a human-readable description in the source code of a computer program
Python has dash standard data types
A dash contains items separated by commas and enclosed within square brackets
A dash consists of key-value pairs
dash cannot be changed and use parentheses

Answers

Answer:

1. Comment

2. Five (5).

3. Line.

4. Tuple; that

Explanation:

1. A comment is a human-readable description in the source code of a computer program. Thus, it's an annotation or description in the source code of a software program that is readable by humans.

2. Python has five (5) standard data types, these includes; number, string, list, dictionary and tuple.

3. A line contains items separated by commas and enclosed within square brackets i.e [ ]. Thus, it's simply an ordered collection of one or multiple data items.

4. A tuple consists of key-value pairs

that cannot be changed and use parentheses. For example, Newtuple = ("strawberry", "apple", "mango", "banana", "orange").

What information is automatically generated from the company identifier and product name?

A.
project name
B.
class prefix
C.
bundle identifier
D.
organization name

Answers

I think it’s project name, but I’m not 100% positive


After you have figured out your storyline, what should be the next thing to
focus on?
1.character devlopment
2. What you want to name your video​

Answers

Answer: 2

A storyline figured out means you should already know the plot, setting, conflict, theme and characters (character development)
Figure out the story line, plan things out

Hi there!
I am writing a research paper on Satellite internet. I have about 4 out of 6 pages of information written down. What are some topics to talk about regarding satellites? It does not have to be specifically about satellites. Just some things to add to the paper. I am not sure what subject it fall under, so i'm going to post it twice.
Thank you in advance.

Answers

Answer:hi there

Explanation:

Satellite Internet access is Internet access provided through communication satellites. Modern consumer grade satellite Internet service is typically provided to individual users through geostationary satellites that can offer relatively high data speeds


Which tab is used to create a
new e-mail?

O File
O View
O Folder
O Home

Please help!!!!!!!!!!!!!

Answers

Answer:

Mail tab

Explanation:

Please mark as brainliest answer as it will also give you 3 points

File , brainliest answer. Hope this helps

You should not photograph where unless you have permission?
O A public park
O Your backyard
O A parade
O Into someone's window
PLZ HELP ME

Answers

Answer:

Into someone's window

Explanation:

We should not photograph into some one's window, unless we have permission

Answer:

Hello There!!

Explanation:

I believe the answer is O Into someone's window.

hope this helps,have a great day!!

~Pinky~

1 punto
María tiene una empresa de mercancia
seca, dicha empresa brinda su servicio de
ventas de estas mercancías al por mayor y
menor para su clientela. ¿De qué tipo de
Comercio hablamos en este ejemplo?: *

Answers

Answer:

Retailing.

Explanation:

La venta al por menor o retailing es el suministro de bienes físicos a los consumidores para uso personal, sea en pequeña o grandes cantidades, siempre que esté destinado a consumidores finales. Es un sector que consta de diferentes ramas (como la industria alimentaria, la industria de la moda, la industria del mobiliario para el hogar, etc.). El comercio minorista es el último eslabón de la cadena de suministro que va desde el fabricante hasta el consumidor.

Select three advantages to using digital video.

A) Digital video appears to have more depth.

B) Digital video can capture a greater range of brightness.

C) Digital video is much less expensive than film.

D) Digital video be easily edited and shared.

E) Digital video can be viewed in real time where it was taken.

Answers

C. E and D, I believe. I apologize if I’m incorrect!

Answer:

Digital video be easily edited and shared., Digital video is much less expensive than film., Digital video can be viewed in real time where it was taken.

Explanation:

Which of the components of the systems model provides information so
the system can adjust its function? *
A. input
B. feedback
C. process
D. output

Answers

Answer: Feedback

Explanation:

The input components of the systems model can consist of resources like people, energy, tools, capital, etc.

The feedback components of the systems model provides information so

the system can adjust its function. An example of the feedback mechanism for a system is the progress bar which shows when one is downloading a file on iTunes.

3 Negative ways of using the Internet​

Answers

Answer:

1. It rots the mind of children

2. It's to too addicting

3. can show bad things.

Explanation:

1. Cyber bullying.
2. Gambling (playing games where you win money)
3. Identity theft, hacking.

C. Assessment Application
MATCHING TYPE
Directions: Match column A with column B. Write the letter of your
answer on the space provided.
А
B В
1. Disk Cleanup
A. Repairs and cleans the Windows Registry
2. ASC
3. Scandisk
B. Repairs registry errors, remove "junk" files,
and ensure your PC is fully protected
C. Creates and deletes disk partitions
D. Accesses various information's about your
computer
E. Tunes up and maintains your PC automatically
F. Optimizes use of space on a disk.
4. ASC Pro
5. Format
6. CPU-Z
7. Defrag
G. Tunes up and maintains your PC, with anti-
spyware, privacy protection, and system
cleaning functions
H. Prepares a hard drive prior to use.
I. Checks for physical errors on the disk surface
J. Removes unused files.
8. ARO 2013
9. Fdisk
10. RegDoctor
--00 End of the Module 00--​

Answers

Answer:

[tex]\begin{array}{lll}&A&B\\1&Disk \ cleanup& Removes \ unused \ files\\2&ASC&Tunes \ up \ and \ mantains \ your \ PC \ automatically\\3&Scan \ disk &Checks \ and \ removes \ errors \ on \ the \ disk \ surface\\4&ASC \ Pro& Tunes \ up \ and \ maintains \ your \ PC, \ with \ anti-spyware, \ privacy \ prot \\\\\end{array}[/tex][tex]\begin{array}{lll}\\5&Format&Prepares \ the \ hard\ drive\ prior \ to \ use\\6&CPU-Z&Accesses \ various \ informations \ about \ your \ computer\\7&De-frag&Optimizes \ use \ of \ space \ on \ disk\\8&ARO \ 2013& Repirs \ registry \ errors, \ removes \ "junk" \ files\\9&Fdisk&Creates \ and \ deletes \ disk \ partitions\\10&RegDoctor&Repair \ and \ cleans \ the \ windows \ registry \end{array}\right][/tex]

Explanation:

discuss why ergonomics is important?​

Answers

Answer: Ergonomics are important because when you're doing a job and your body is stressed by an awkward posture, extreme temperature, or repeated movement your musculoskeletal system is affected.

PLEASEEEE HELPPP!!!!! Which graphic design tool should you use to achieve the effect in the image shown here?

A. Move
B. color and painting tools
C. Layers
D. Marquee
E. Crop

Will give brainlist if right!!! Thx

Answers

Answer:

I think the answer is b yep b

what is the effect of flattening layers in image editing?
you can reduce file size by flattening layers. this operation mergers all ___ layers into the background and discards hidden layers.
all ___ areas that remain are filled with white.

first blank
a. black
b. colored
c. transparent

second blank
a. dark
b. visible
c. bright

Answers

The answer to this blanks are black and visible

Answer:

Hello There!!

Explanation:

I believe the answers are:

-First blank=>c. transparent

-Second blank=>b. visible.

hope this helps,have a great day!!

~Pinky~

An investment bank has a distributed batch processing application which is hosted in an Auto Scaling group of Spot EC2 instances with an SQS queue. You configured your components to use client-side buffering so that the calls made from the client will be buffered first and then sent as a batch request to SQS. What is a period of time during which the SQS queue prevents other consuming components from receiving and processing a message

Answers

Answer: Visibility timeout

Explanation:

The period of time during which the SQS queue prevents other consuming components from receiving and processing a message is known as the visibility timeout.

It is the length of time when a message will be hidden after such message has been grabbed by a consumer. It is essential as it prevents others from processing such message again.

Which statement is true? Select 3 options.
1. Deques can be created empty.
2. Deques are lists.
3. Lists are deques.
4. Deques can contain lists.
5. A deque is a type of collection.

Answers

Answer:

2nd statement is True dear!!!

Answer:

Deques can contain lists.

A deque is a type of collection.

Deques can be created empty.

Explanation:

Answers can be found in Edge instructions

"You can make a deque whose members are lists."

"You can create an empty deque or create a deque with a list or a string."

"You have used lists and deques, which are two types of collections used by Python. "

Which option is not available in the Presenter view of a presentation?

Answers

Group of answer choices.

A. Next Slide Preview

B. Pen/Laser Pointer tools

C. Open Slide Show

D. Navigation Controls

Answer:

C. Open Slide Show

Explanation:

PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation.

Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

Basically, the views that are available on the Microsoft PowerPoint application includes;

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Presenter view avails the user an ability to use two monitors to display his or her presentation. Thus, one of the monitors displays the notes-free presentation to your audience while the other monitor lets you view the presentation with notes that you have added to the slides, as well as the navigation and presentation tools.

Furthermore, the Presenter view was developed by Microsoft Inc. to have the following options;

I. Next Slide Preview.

II. Pen/Laser Pointer tools.

III. Navigation Controls.

However, Open Slide Show is an option which is not available in the Presenter view of a presentation.

how much video does a 10gb video hold i will give brainliest for first correct answer

Answers

Answer:

2,000 songs

Explanation:

Q.No.2. A study of the effect of smoking on sleep patterns is conducted. The measure observed is the time, in minutes, that it takes to fall asleep. These data are obtained: [3] Smokers:69.3 56.0 22.1 47.6 53.2 48.1 52.7 34.4 60.2 43.8 23.2 13.8 Non Smokers: 28.6 25.1 26.4 34.9 28.8 28.4 38.5 30.2 30.6 31.8 41.6 21.1 36.0 37.9 13.9

Answers

Answer:

(a) [tex]\bar x_1 = 43.7[/tex]     [tex]\bar x_2 = 30.25[/tex]

(b) [tex]\sigma_1 = 16.93[/tex]    [tex]\sigma_2 = 7.14[/tex]

(c) Smoking increases the time to fall asleep

Explanation:

Solving (a): The sample mean of each group

Mean is calculated as:

[tex]\bar x = \frac{\sum x}{n}[/tex]

So, we have:

Smokers

[tex]n_1= 12[/tex] and

[tex]\bar x_1 = \frac{69.3 +56.0+ 22.1 +47.6+ 53.2+ 48.1+ 52.7 +34.4+ 60.2 +43.8 +23.2 +13.8}{12}[/tex]

[tex]\bar x_1 = \frac{524.4}{12}[/tex]

[tex]\bar x_1 = 43.7[/tex]

Non Smokers

[tex]n_2 = 15[/tex] and

[tex]\bar x = \frac{28.6 +25.1 +26.4 +34.9 +28.8 +28.4 +38.5 +30.2 +30.6 +31.8 +41.6 +21.1 +36.0 +37.9 +13.9}{15}[/tex]

[tex]\bar x_2 = \frac{453.8}{15}[/tex]

[tex]\bar x_2 = 30.25[/tex]

Solving (b): The standard deviation of each group

This is calculated as:

[tex]\sigma = \sqrt{\frac{\sum(x - \bar x)^2}{n-1}}[/tex]

For smokers

[tex]n_1= 12[/tex]

So:

[tex]\sigma_1 = \sqrt{\frac{(69.3 -43.7)^2+(56.0-43.7)^2+..........+(13.8-43.7)^2}{12-1}}[/tex]

[tex]\sigma_1 = \sqrt{\frac{3152.04}{11}}[/tex]

[tex]\sigma_1 = \sqrt{286.5491}[/tex]

[tex]\sigma_1 = 16.93[/tex]

For non-smokers

[tex]n_2 = 15[/tex]

So:

[tex]\sigma_2 = \sqrt{\frac{(28.6 -30.25)^2+(25.1 -30.25)^2+..........+(13.9 -30.25)^2}{15-1}}[/tex]

[tex]\sigma_2 = \sqrt{\frac{713.2575}{14}}[/tex]

[tex]\sigma_2 = \sqrt{50.9469}[/tex]

[tex]\sigma_2 = 7.14[/tex]

Solving (c): Impact of smoking on time to sleep

In (b), we have:

[tex]\sigma_1 = 16.93[/tex] --- smokers

[tex]\sigma_2 = 7.14[/tex] --- non-smokers

Smokers have larger standard deviation (i.e. large variability) than non-smokers. This means that smokers require more time to fall asleep.

How long you plan to keep your investments in your portfolio refers to:
A. Time horizon
B. Asset allocation
C. Personal financial health
D. Risk tolerance

Answers

Answer:

A, because it has to do with the amount of time you have it in your portfolio.

How do you debug an Xcode project?

A.
by selecting the Debug option in the Tools menu
B.
by clicking on the Debug Navigator
C.
by clicking on the Run button
D.
by clicking on the Debug button on the bottom right

Answers

Answer:

in my opinion i think it is "C" by clicking on the run button...

spam and i report
Maurice wants to create a variable to store the name of the second-best taco place. Maurice writes the line of code as 2ndtaco = "Tio Dan's" but gets an error message. What is the problem with Maurice’s code?

A.
There can’t be an apostrophe ' in a variable name.

B.
The equals sign should be a dash.

C.
The type of variable wasn’t specified.

D.
A variable name can’t begin with a number.

Answers

Answer:

option d is the correct answer

Answer:

For your other question I think it's true

Explanation:

You are going to create multiple functions that will take in the appropriate measurements as parameters and calculate the area of the specific shape.

The following shapes must be included:
Square, Triangle, Circle, and Trapezoid

Feel free to add on more shapes if you want!!

Answers

Answer:

circle

Explanation:

Answer:

circle

Explanation:

In 2011, a company called RSA, which provides security services, acknowledged its proprietary authentication system, which is employed by some defense contractors and other high-security industries, was compromised. As a result, the attackers were also able to log into systems at Lockheed Martin, and other companies, using the stolen credentials of legitimate users. This is an example of violation of ___________________.

Answers

Answer:

The answer is "Authentication"

Explanation:

The attacker had the opportunity to log into the legitimate users' stolen credentials in Boeing systems and other firms in this question. That's an example of a verification violation.

This is a recognition of the identification of a user. Various students typically require various kinds of certificates in order to create the identity of the user. The credentials are frequently a passcode that only people and the computer know and seem to be confidential.

Suppose a large group of people in a room were all born in the same year. Consider the following three algorithms, which are each intended to identify the people in the room who have the earliest birthday based on just the month and day. For example, a person born on February 10 is considered to have an earlier birthday than a person born on March 5. Which of the three algorithms will identify the correct people?
I. All the people in the room stand up. All standing people form pairs where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing, while the other person in the pair sits down. If there is a tie, both people sit down. Any individual not part of a pair remains standing. Continue doing this until only one person remains standing. That person has the earliest birthday.
II. All the people in the room stand up. All standing people form pairs with another standing person that they have not previously been paired with where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing, while the other person in the pair sits down. If there is a tie, both people in the pair remain standing. Any individual not part of a pair remains standing. Continue doing this until only one person remains standing or all persons standing have the same birthday. Anyone still standing has the earliest birthday.
III. Beginning with the number 1, ask if anyone was born on that day of any month. Continue with the numbers 2, 3, and so on until a positive response is received. If only one person responds, that person has the earliest birthday. If more than one person responds, determine which person was born in the earliest month, and that person or those persons have the earliest birthday.

Answers

Answer:

II is correct.

Explanation:

Algorithm is a computer program which solves complex problems within minutes. The algorithms has different variants which are used according to user demand. In the given scenario the choice no II is correct. All standing people can form a pair with another standing person and the person standing in the last will have the earliest birthday.

Read the integer numbers in the text file "1000 Random Number from 0 to 100.txt" into a list

PLEASE HELP THANK U!!

Answers

Answer:

random_number_file = open("1000 Random Number from 0 to 100.txt", 'r')

random_number_list = random_number_file.readlines()

print('random_number_list)

Explanation:

The name of the file containing the random integer text is ; "1000 Random Number from 0 to 100.txt"

The random_number_file variable stores the opened file ("1000 Random Number from 0 to 100.txt") using the open keyword and reads it ('r')

This file stored in the random_number_file variable is the read into a list by using the readlines() method on the random_number_file

name any three data items that can be you can be encoded using magnetized ink ​

Answers

Answer:

U+2446 ⑆ OCR BRANCH BANK IDENTIFICATION.

U+2447 ⑇ OCR AMOUNT OF CHECK.

U+2448 ⑈ OCR DASH (corrected alias MICR ON US SYMBOL)

U+2446 ⑆ OCR BRANCH BANK IDENTIFICATION, U+2447 ⑇ OCR AMOUNT OF CHECK and U+2448 ⑈ OCR DASH (corrected alias MICR ON US SYMBOL) are the three data items that can be encoded using magnetized ink ​

What is meant by encoded?

Encoding is the process of arranging a string of characters letters, numbers, punctuation, and some symbols in a particular format for quick transmission or storage. The process of converting an encoded format back into the original string of characters is known as decoding.

Thus, the item is mentioned in the above statement.

For more details about encoded, click here:

https://brainly.com/question/18182530

#SPJ2

Other Questions
1d. Conservation of energy is demonstrated in this roller coaster example.The Conservation of Energy is a principle which states that energy cannot be createdor destroyed, but can be altered from one form to anotherFriction plays a significant role in the efficiency of the rollercoaster cars. Explain how, evenwith friction, the law of conservation of energy still holds true. (2 points) what happen when I put a coloured ice cube in warm water (05.06 MC)Choose the function to match the graph.-65332.1-202.3456-1-21 PLSSS HELP NOW plssssssssssssssssssssssss 38. Consider the following equilibrium:2CO(g) + O2(g) =2CO2Keg=4.0 x 10-10What is the value of Key for 2CO2(g) + 2COR + O2g) ? To quit, a user types 'q'. To continue, a user types any other key. Which expression evaluates to true if a user should continue If j=h and k=m then which expression represents the value of g Solve the inequality. |6p+3|>15 A p3 B p>2 or p2 or p can someone help i dont understand exponential functions Which quotient is greater than 3? 28 divided by 10, 35 divided by 11, 38 divided by 13 or 40 divided by 14 what issues are better dealt with at the local government level instead of the state level 5 questions with Do and 5 questions with Does english english english plss i dont speak english please help What's the value of x in the figure?a)33 degreesb)78 degreesc)57 degreesd)76 degrees The Smith family have decided to build a uniform walkway that is 3 ft wide using Travertine pavers around their rectangular swimming pool which measures 16 ft by 24 ft.What is the area of the walkway? - 384 ft sq.The paver selected by the family measures 6 in by 12 in. How many pavers are needed to cover the walkway? Quistion in picture only for WXI Why is it easy to hammer a sharp pin than a blunt pin ? * you toss six coins at the same time. how many possible outcomes are there?6436126 Who was the Soviet Premiere who came to power in 1985?O Nikita KhrushchevO Mikhail GorbachevO Leonid BrezhnevO Boris Yeltsin [tex] {( \frac{5}{3} )}^{2n + 1} {( \frac{5}{3} )}^{5} = ({ \frac{5}{3} )}^{n + 2} [/tex]Pls include steps... Can anyone help me with this please? I need help along with an explanation.