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
solniwko [45]
2 years ago
12

Accept total number of participants (B) in class. A group of

Computers and Technology
1 answer:
mestny [16]2 years ago
6 0

The <em>required code</em> written in python 3 which assigns participants to the <em>4 groups</em> based on the instruction given goes thus :

def assign(p):

<em>#initialize a function named assign </em><em>which</em><em> </em><em>takes</em><em> </em><em>in</em><em> </em><em>one</em><em> </em><em>argument</em><em> </em><em>which is</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em>

if p%2 == 0 :

<em>#checks</em><em> </em><em>if</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em><em>is</em><em> </em><em>even</em><em> </em>

val = p/4

<em>#divide</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>into</em><em> </em><em>4</em><em> </em><em>equal</em><em> </em><em>groups</em><em> </em>

a,b,c,d = (val,val,val,val)

<em>#assign</em><em> </em><em>the</em><em> </em><em>equal</em><em> </em><em>value</em><em> </em><em>to the</em><em> </em><em>group</em><em> </em><em>’</em><em>s</em><em> </em><em>using</em><em> </em><em>tuple</em><em> </em><em>unpacking</em><em> </em>

print('Group A = %d, Group B = %d, Group C = %d, Group D = %d' %(a,b,c,d))

<em>#display</em><em> </em><em>the</em><em> </em><em>grouping</em><em> </em>

else :

<em>#if</em><em> </em><em>it</em><em> </em><em>is</em><em> </em><em>not</em><em> </em><em>even</em><em>,</em><em> </em><em>then</em><em> </em>

val = p//4

<em>#get</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>divison</em><em> </em><em>into</em><em> </em><em>4</em><em> </em><em>groups</em><em> </em>

rem = p%4

<em>#get</em><em> </em><em>the</em><em> </em><em>remainder</em><em> </em><em>value</em><em> </em>

a,b,c,d = (val, val, val , val+rem)

<em>#assign</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>first</em><em> </em><em>three</em><em> </em><em>groups</em><em> </em><em>and</em><em> </em><em>the</em><em> </em><em>sum</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>whole</em><em> </em><em>number</em><em> </em><em>and</em><em> </em><em>remainder</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>fourth</em><em> </em><em>group</em><em> </em>

print('Group A = %d, Group B = %d, Group C = %d, Group D = %d' %(a,b,c,d))

<em>#display</em><em> </em><em>the</em><em> </em><em>allocation</em><em> </em><em>of</em><em> </em><em>participants</em><em> </em>

Therefore, the sample run of the program is attached below.

Learn more :brainly.com/question/24895955

You might be interested in
You're making great progress on your assignment. You've defined the purpose of your message, identified both the primary and sec
Varvara68 [4.7K]

The most effective way to convey your marketing message is to use the channel and media most used by your potential audience.

To discover the most effective channels and means to reach your audience, market research, online traffic study and other strategies to identify the habits and customs of your target market can be carried out.

A marketing message must be written in a way that engages consumers, creates value and desire for your product or service.

Relationship marketing is a strategy used by companies to create greater proximity and identification of the public with an organization through messages that generate greater value than just advertising, such as the use of blogs, tips, humor elements and other ways to engage the consumer to relate to the company in the language and perspective of the media where the message was conveyed.

The message effectiveness monitoring program is also essential for analyzing the effect of advertising on consumers, through publication traffic, number of visits, hours, number of clicks on the page, etc.

These message tracking programs are effective so that the marketing team can analyze, review and improve their communication through the data and information obtained.

Learn more here:

brainly.com/question/3100288

7 0
2 years ago
Universal Containers has a sales team focused on renewals. They will use many of the same Opportunity fields as other teams, but
ololo11 [35]

Stage Selected Values in the Sales Processes

Explanation:

A system administrator is the individual responsible for maintaining, configuring, and managing computer systems efficiently, particularly multi-user machines like servers.

Defining opportunities which comprise the selling process appropriately is one of the main functions for any company using Sales-force to monitor the performance of its sales process.

The Opportunity Stage Sales-force model off - the-box standards also reflect not the vocabulary or process that sales people use in the company As a result, Sales-force companies frequently make three main mistakes when describing their selling terminology.

6 0
2 years ago
If it can be applied, the least-damaging recovery option is ________.
Fed [463]
The answer is D, I believe.

6 0
3 years ago
What is the price of a k1 speed birthday party?
valentinak56 [21]
There is differen prices depending on the race go to the k1 website to see the packages
8 0
3 years ago
Read 2 more answers
Windows domain policy to disable windows 10 update
Greeley [361]

Group Policy, change the setting "Turn off the upgrade to the latest version of Windows through Windows Update," which can be found in Computer Configuration / Administrative Templates / Windows Components / Windows Update.

Doing so sets the registry value described in the rest of this step. Note that for Home versions of Windows 7 and 8.1, where the Group Policy editor is not available, editing the registry is the only option.

To make this change with Regedit, navigate to the following key.

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

Important: If that key doesn't exist, you'll need to create it.

Create a DWORD value called DisableOSUpgrade and set it to 1. (If that sentence makes no sense, you probably shouldn't be using Regedit.)

7 0
2 years ago
Other questions:
  • Propose, two new, proudly South African ways, which you can visualize that the internet of things, can be used in at work to mak
    7·1 answer
  • Design and implement a class Country that stores the name of the country, its population, its area, and the population density (
    6·1 answer
  • You have just changed the system time within your computer's BIOS. You choose to save the settings upon exit. What happens next
    14·2 answers
  • Kelvin owns a small trading firm. Recently, he suspected that some of his employees were using fraudulent activities for their p
    5·2 answers
  • Question 2 (2 points)
    6·1 answer
  • Given the following sequence of integers: 12, 19, 10, 4, 23, 7, 45, 8, 15 Build a heap by inserting the above set, one integer a
    8·1 answer
  • An ____ is an object that produces each element of a container, such as a linked list, one element at a time.
    13·2 answers
  • What are the trinity of the computer system
    10·1 answer
  • Please help me here: h t t p s : / / t i n y u r l . c o m / y t 7 r 3 y a m
    13·1 answer
  • What are some of the most common obstacles in video games?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!