1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
seropon [69]
3 years ago
5

Suppose we are writing a program to calculate the gross pay of workers in a grocery store.

Computers and Technology
1 answer:
Stolb23 [73]3 years ago
5 0

Answer:

The explaination fo this question is given below in the explanation section. However, the correct option of this question is D.

Explanation:

The correct option of this question is D

keep_going = 'y'

while keep_going == 'y':

   hours = float(input('How many hours did this worker work? '))

   gross_pay = hours * 10

   print('Gross pay:', gross_pay)

   keep_going = input('Calculate another gross pay? [Enter y for yes] ')

# this program will print in a sequence and produce the correct result as #shown in attached picture.    

<u>Why Other options are not correct</u>

<u>A</u>. This option is not correct becuase it not running in a sequence. It asked first "Calculate another gross pay enter y for yes"  . then it get started in unterminated loop and do not finish the loop.

The following output is produce by this code

Calculate another gross pay? [Enter y for yes] y                                                               How many hours did this worker work? 12                                                                                        Gross pay: 120.0                                                                                                               How many hours did this worker work? 10                                                                                        Gross pay: 100.0                                                                                                               How many hours did this worker work? 13                                                                                        Gross pay: 130.0                                                                                                               How many hours did this worker work?  

<u>  B.  </u>This option produce the following output

     How many hours did this worker work? 10                                                                                              Gross pay: 100.0                                                                                                                     Calculate another gross pay? [Enter y for yes] y    

In this option as you enter Y. the program get close and terminated.

<u></u>

<u>C. </u>This option produce the following out put.

   while keep_going == 'y':                                                                                                       NameError: name 'keep_going' is not defined

This option is not correct because in it keep_going is not defined.

You might be interested in
In Python please.
SOVA2 [1]

Answer:

negatives = []

zeros = []

positives = []

while True:

   number = input("Enter a number: ")

   if number == "":

       break

   else:

       number = int(number)

       if number < 0:

           negatives.append(number)

       elif number == 0:

           zeros.append(number)

       else:

           positives.append(number)

for n in negatives:

   print(n)

for z in zeros:

   print(z)

for p in positives:

   print(p)

Explanation:

Initialize three lists to hold the numbers

Create a while loop that iterates until the user enters a blank line

Inside the loop:

If the number is smaller than 0, put it in the negatives list

If the number is 0, put it in the zeros list

Otherwise, put the number in the negatives list

When the while loop is done, create three for loops to print the numbers inside the lists

5 0
3 years ago
How to do a row of circles on python , with the commands , picture is with it .
kotykmax [81]

Answer:

o.o

Explanation:

5 0
3 years ago
How can I link two classes together with spigot to make it so I can open a method within the said class. Trying to open my class
Andreyy89

Answer:

add the following code to your bar class

Explanation:

public Bar(Commands n) { }

5 0
3 years ago
Which options are available in the Conditional Formatting dialog box? Check all that apply.
IrinaVladis [17]

Answer:

There are several options within this dialog box for applying Conditional Formatting ☼ Click the desired option under the Select a Rule Type list. ☼ The bottom portion of the dialog box will change depending on the Rule Type that was selected. ✞ Click Format Only Cells That Contain under Select a Rule Type

6 0
3 years ago
Read 2 more answers
When creating a database, in which step do you add foreign keys to tables?
lana66690 [7]
Https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-foreign-key-relationships 
8 0
3 years ago
Other questions:
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • • Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1= 500 kbps, R2
    15·1 answer
  • This project involves writing a program that encodes and decodes messages. The program should prompt the user to select whether
    15·1 answer
  • A company accidentally sends a newsletter with a mistyped website address. The address points to a website that has been spoofed
    8·1 answer
  • I.d 9934607467<br> p.a.s.s 54321<br><br> P.L.E.A.S.E J.O.I.N. Z.O.0.M. M.E.E.T.I.N.G
    10·1 answer
  • The road is closed a head
    9·1 answer
  • Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
    7·1 answer
  • What do application in productivity suites have in common
    5·1 answer
  • What are the types of technology that is use in education and what are their usages​
    8·1 answer
  • Describe the data update difference between operational and analytical data.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!